You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Joni Lee <we...@yahoo.com> on 2012/06/21 23:31:39 UTC

Java & Python in distributed nodes

Hi all,

I'm very fascinated with the distributed components of SCA, whereby different components running on different machines. For the first try, i want to call python component from a Java component. Both on different nodes and start them on local machine.
For this I extend the project samples/calculator-distributed by adding a python component to a node B as follows

    // Add a Python component in src/main/resources/nodeB/Calculator.composite

    <component name="HelloServiceComponent">
        <tuscany:implementation.script script="calculator/HelloServiceImpl.py"/>
        <service name="HelloService">
        <interface.java interface="calculator.HelloService" />
        </service>
    </component>

the script HelloServiceImpl.py is put in the same directory of the composite of node B (src/main/resources/nodeB)
the Java interface is put in src/main/java/calculator/HelloService.java

But I cannot start the node

21-Jun-2012 17:16:42 org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl
WARNING: Service not found for component service: Component = HelloServiceComponent Service = HelloService
21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
SEVERE: HTTP Server Error : java.lang.ClassCastException: org.apache.tuscany.sca.assembly.impl.ComponentImpl cannot be cast to org.apache.tuscany.sca.runtime.RuntimeComponent
21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor

Any suggestions? Do I miss something important?

Thank you very much

Re: Java & Python in distributed nodes

Posted by Luciano Resende <lu...@gmail.com>.
On Fri, Jun 22, 2012 at 2:25 AM, Joni Lee <we...@yahoo.com> wrote:
> Hi Raymond,
>
> We are developing a cloud architecture here and first take a look at the
> distributed nodes of Tuscany.
>
> I use maven to run it, and it does not work, even with dependency
> tuscany-core
> what I did is simply extend your existing sample
> (samples/calculator-distributed) with a python component, instead of a java
> component in one node.
>
> Do I miss something important? Because I can build and run the original
> sample project without problems.
> thank you for your answers.
>
> ________________________________
> From: Raymond Feng <en...@gmail.com>
> To: user@tuscany.apache.org; Joni Lee <we...@yahoo.com>
> Sent: Thursday, June 21, 2012 11:40 PM
> Subject: Re: Java & Python in distributed nodes
>
> It seems that you are missing some dependencies such as tuscany-core on the
> classpath.
>
> Thanks,
> Raymond
> On Jun 21, 2012, at 2:31 PM, Joni Lee wrote:
>
> Hi all,
>
> I'm very fascinated with the distributed components of SCA, whereby
> different components running on different machines. For the first try, i
> want to call python component from a Java component. Both on different nodes
> and start them on local machine.
> For this I extend the project samples/calculator-distributed by adding a
> python component to a node B as follows
>
>     // Add a Python component in
> src/main/resources/nodeB/Calculator.composite
>
>     <component name="HelloServiceComponent">
>         <tuscany:implementation.script
> script="calculator/HelloServiceImpl.py"/>
>         <service name="HelloService">
>         <interface.java interface="calculator.HelloService" />
>         </service>
>     </component>
>
> the script HelloServiceImpl.py is put in the same directory of the composite
> of node B (src/main/resources/nodeB)
> the Java interface is put in src/main/java/calculator/HelloService.java
>
> But I cannot start the node
>
> 21-Jun-2012 17:16:42
> org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl
> WARNING: Service not found for component service: Component =
> HelloServiceComponent Service = HelloService
> 21-Jun-2012 17:16:42
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
> SEVERE: HTTP Server Error : java.lang.ClassCastException:
> org.apache.tuscany.sca.assembly.impl.ComponentImpl cannot be cast to
> org.apache.tuscany.sca.runtime.RuntimeComponent
> 21-Jun-2012 17:16:42
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
>
> Any suggestions? Do I miss something important?
>
> Thank you very much
>
>
>
>

BTW, Are you using 1.x or 2.x ?


-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: Java & Python in distributed nodes

Posted by Joni Lee <we...@yahoo.com>.
Hi Raymond,

We are developing a cloud architecture here and first take a look at the distributed nodes of Tuscany.

I use maven to run it, and it does not work, even with dependency tuscany-core
what I did is simply extend your existing sample (samples/calculator-distributed) with a python component, instead of a java component in one node.

Do I miss something important? Because I can build and run the original sample project without problems.
thank you for your answers.



________________________________
 From: Raymond Feng <en...@gmail.com>
To: user@tuscany.apache.org; Joni Lee <we...@yahoo.com> 
Sent: Thursday, June 21, 2012 11:40 PM
Subject: Re: Java & Python in distributed nodes
 

It seems that you are missing some dependencies such as tuscany-core on the classpath.

Thanks,
Raymond

On Jun 21, 2012, at 2:31 PM, Joni Lee wrote:

Hi all,
>
>
>I'm very fascinated with the distributed components of SCA, whereby different components running on different machines. For the first try, i want to call python component from a Java component. Both on different nodes and start them on local machine.
>For this I extend the project samples/calculator-distributed by adding a python component to a node B as follows
>
>
>    // Add a Python component in src/main/resources/nodeB/Calculator.composite
>
>
>    <component name="HelloServiceComponent">
>        <tuscany:implementation.script script="calculator/HelloServiceImpl.py"/>
>        <service name="HelloService">
>        <interface.java interface="calculator.HelloService" />
>        </service>
>    </component>
>
>
>the script HelloServiceImpl.py is put in the same directory of the composite of node B (src/main/resources/nodeB)
>the Java interface is put in src/main/java/calculator/HelloService.java
>
>
>But I cannot start the node
>
>
>21-Jun-2012 17:16:42 org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl
>WARNING: Service not found for component service: Component = HelloServiceComponent Service = HelloService
>21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
>SEVERE: HTTP Server Error : java.lang.ClassCastException: org.apache.tuscany.sca.assembly.impl.ComponentImpl cannot be cast to org.apache.tuscany.sca.runtime.RuntimeComponent
>21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
>
>
>Any suggestions? Do I miss something important?
>
>
>Thank you very much

Re: Java & Python in distributed nodes

Posted by Raymond Feng <en...@gmail.com>.
It seems that you are missing some dependencies such as tuscany-core on the classpath.

Thanks,
Raymond
On Jun 21, 2012, at 2:31 PM, Joni Lee wrote:

> Hi all,
> 
> I'm very fascinated with the distributed components of SCA, whereby different components running on different machines. For the first try, i want to call python component from a Java component. Both on different nodes and start them on local machine.
> For this I extend the project samples/calculator-distributed by adding a python component to a node B as follows
> 
>     // Add a Python component in src/main/resources/nodeB/Calculator.composite
> 
>     <component name="HelloServiceComponent">
>         <tuscany:implementation.script script="calculator/HelloServiceImpl.py"/>
>         <service name="HelloService">
>          	<interface.java interface="calculator.HelloService" />
>         </service>
>     </component>
> 
> the script HelloServiceImpl.py is put in the same directory of the composite of node B (src/main/resources/nodeB)
> the Java interface is put in src/main/java/calculator/HelloService.java
> 
> But I cannot start the node
> 
> 21-Jun-2012 17:16:42 org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl
> WARNING: Service not found for component service: Component = HelloServiceComponent Service = HelloService
> 21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
> SEVERE: HTTP Server Error : java.lang.ClassCastException: org.apache.tuscany.sca.assembly.impl.ComponentImpl cannot be cast to org.apache.tuscany.sca.runtime.RuntimeComponent
> 21-Jun-2012 17:16:42 org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor
> 
> Any suggestions? Do I miss something important?
> 
> Thank you very much