Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Service Component Architecture (SCA) Tools » help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working
help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483399] Tue, 01 September 2009 13:11 Go to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
newbie here wonder if someone can help

I have gallileo with stp 2.0.0.9 and 1.6.13 java vm

i have downloaded v1.5 and v2 m3 tuscany binarys and installed on
harddrive.

have created two user librarries in eclipse
tuscnay v1 libs - pointed at tuscany 1.5/lib/tuscany_sca_all.jar

and tuscany v2 libs - pointed to tuscany v2m3/module/*.jar
(cant find a /lib directory in V2 at all - is that intentional??)

created two user projects for "hello world" app quick test

used the sca editor to create demoSCA.composite as follows in both v1 and
v2 apps

<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
targetNamespace="http://eclipse.org/demoSCA/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="helloWorld">
<sca:interface.java interface="HelloWorld"/>
<sawsdl:semantic.sawsdl/>
</sca:service>
<sawsdl:semantic.sawsdl/>
</sca:component>
<sca:service name="helloWorld" promote="HelloWorldComponent/helloWorld">
<sca:interface.java interface="HelloWorld"/>
</sca:service>
</sca:composite>

I have a simple interface (HelloWorld.java) marked as @Remotable (one
method)

and a simple implementation marked with @Service (HelloWorld.class) which
just returns a String

I have standalone client class to drive the simple project

import org.apache.tuscany.sca.host.embedded.SCADomain;

//demoV1SCA.java
public class demoV1Main
{

/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node


System.out.println("starting new domain\n");

// Locate the service using SCA APIs
SCADomain domain = SCADomain.newInstance("demoSCA");

System.out.println("lookup service\n");
HelloWorld hello = domain.getService(HelloWorld.class, "HelloWorld");


// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

SCADomain.removeInstance(domain);
}


}

when i run this as an applicaqtion it errors with

starting new domain

01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: demoSCA
01-Sep-2009 14:05:49
org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator
start
WARNING: Class proxys not supported due to
NoClassDefFoundError:net/sf/cglib/proxy/Callback
01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper
startModules
WARNING: Exception starting module
org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator
:org/apache/axiom/om/OMElement
01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper
startModules
WARNING: Exception starting module
org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
:javax/servlet/ServletException
01-Sep-2009 14:05:50
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor
SEVERE: IllegalStateException
Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.core.assembly.ActivationException:
org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.neethi.Policy
at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
at
org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANo deFromClassLoader(NodeFactoryImpl.java:37)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.i nit(DefaultSCADomain.java:178)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init >(DefaultSCADomain.java:100)
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInst ance(SCADomain.java:182)
at
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(S CADomain.java:63)
at demoV1Main.main(demoV1Main.java:22)
Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.neethi.Policy
at
org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:305)
at
org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.start(R untimeBootStrapper.java:187)
at
org.apache.tuscany.sca.node.impl.NodeImpl.initRuntime(NodeIm pl.java:465)
at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:193)
... 6 more
Caused by:
org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.neethi.Policy
at
org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 61)
at
org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:278)
... 9 more
Caused by: java.lang.IllegalStateException:
java.lang.ClassNotFoundException: org.apache.neethi.Policy
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:378)
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.addArtifactProcessor(DefaultStA XArtifactProcessorExtensionPoint.java:103)
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.loadArtifactProcessors(DefaultS tAXArtifactProcessorExtensionPoint.java:191)
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:125)
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:56)
at
org.apache.tuscany.sca.contribution.processor.ExtensibleStAX ArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java: 136)
at
org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:156)
at
org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:56)
at
org.apache.tuscany.sca.contribution.processor.DefaultURLArti factProcessorExtensionPoint$LazyURLArtifactProcessor.read(De faultURLArtifactProcessorExtensionPoint.java:222)
at
org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:57)
at
org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:55)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 55)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at
org.apache.tuscany.sca.extensibility.ClassLoaderServiceDisco verer$ServiceDeclarationImpl.loadClass(ClassLoaderServiceDis coverer.java:88)
at
org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:376)
... 22 more


and my version 2 app (cant find an SCADOmain.class in version 2 build - so
did a google search and came up with somthing like this

//demoV2SCA
import org.apache.tuscany.sca.node.Client;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;


public class demoV2Main
{

/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node

NodeFactory nf = NodeFactory.newInstance();

//String root =
ContributionLocationHelper.getContributionLocation("HelloWorld ");
//Contribution contribution = new Contribution(root, root);

Node node = nf.createNode();

System.out.println("start tuscany node \n");
node.start();

HelloWorld hello = ((Client)node).getService(HelloWorld.class,
"HelloWorld");

// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

node.stop();
}


}

which errors with

Exception in thread "main" org.oasisopen.sca.ServiceRuntimeException: No
SCA contributions are found on the classpath
at
org.apache.tuscany.sca.node.NodeFactory.createNode(NodeFacto ry.java:367)
at demoV2Main.main(demoV2Main.java:25)


so what am i doing wrong and how do i get a simple app up and running in
eclipse

Any help greatfully received - i have got stuck i think
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483436 is a reply to message #483399] Tue, 01 September 2009 15:39 Go to previous messageGo to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,

For Tuscany 2.x, an exception would be normal, as it is not yet
supported. I started to work on it but I could not find time to finish it.

So, deploying an SCA application with SCA Tools can only be done with
Tuscany 1.x for the moment.

For Tuscany 1.5, and given the exception you got, it seems it is an
error in your SCA application and not in the deployment tool. The
deployment tool creates a client smilar to the one you wrote below
(demoV1Main).

What happens if you remove the sawsdl annotations from your composite?
Does it solve the problem?

About Tuscany 2, I think it is related to the OASIS namespace, which is
not yet covered by the released SCA Tools. It is on the roadmap. You
should replace the "sca" namespace in your composite by the OASIS one
(it must be available in the samples running on Tuscany 2).


Let me know if it helps.


Vincent.




William Woodman a écrit :
> newbie here wonder if someone can help
>
> I have gallileo with stp 2.0.0.9 and 1.6.13 java vm
>
> i have downloaded v1.5 and v2 m3 tuscany binarys and installed on
> harddrive.
>
> have created two user librarries in eclipse tuscnay v1 libs - pointed at
> tuscany 1.5/lib/tuscany_sca_all.jar
>
> and tuscany v2 libs - pointed to tuscany v2m3/module/*.jar (cant find a
> /lib directory in V2 at all - is that intentional??)
>
> created two user projects for "hello world" app quick test
> used the sca editor to create demoSCA.composite as follows in both v1
> and v2 apps
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://eclipse.org/demoSCA/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="helloWorld">
> <sca:interface.java interface="HelloWorld"/>
> <sawsdl:semantic.sawsdl/>
> </sca:service>
> <sawsdl:semantic.sawsdl/>
> </sca:component>
> <sca:service name="helloWorld" promote="HelloWorldComponent/helloWorld">
> <sca:interface.java interface="HelloWorld"/>
> </sca:service>
> </sca:composite>
>
> I have a simple interface (HelloWorld.java) marked as @Remotable (one
> method)
>
> and a simple implementation marked with @Service (HelloWorld.class)
> which just returns a String
>
> I have standalone client class to drive the simple project
> import org.apache.tuscany.sca.host.embedded.SCADomain;
>
> //demoV1SCA.java
> public class demoV1Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
> when i run this as an applicaqtion it errors with
> starting new domain
>
> 01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: demoSCA
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator
> start
> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator
> :org/apache/axiom/om/OMElement
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
> :javax/servlet/ServletException
> 01-Sep-2009 14:05:50
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor
>
> SEVERE: IllegalStateException
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
> org.apache.tuscany.sca.core.assembly.ActivationException:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
> at
> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANo deFromClassLoader(NodeFactoryImpl.java:37)
>
> at
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.i nit(DefaultSCADomain.java:178)
>
> at
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init >(DefaultSCADomain.java:100)
>
> at
> org.apache.tuscany.sca.host.embedded.SCADomain.createNewInst ance(SCADomain.java:182)
>
> at
> org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(S CADomain.java:63)
>
> at demoV1Main.main(demoV1Main.java:22)
> Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:305)
>
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.start(R untimeBootStrapper.java:187)
>
> at
> org.apache.tuscany.sca.node.impl.NodeImpl.initRuntime(NodeIm pl.java:465)
> at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:193)
> ... 6 more
> Caused by:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 61)
>
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:278)
>
> ... 9 more
> Caused by: java.lang.IllegalStateException:
> java.lang.ClassNotFoundException: org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:378)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.addArtifactProcessor(DefaultStA XArtifactProcessorExtensionPoint.java:103)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.loadArtifactProcessors(DefaultS tAXArtifactProcessorExtensionPoint.java:191)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:125)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:56)
>
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAX ArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java: 136)
>
> at
> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:156)
>
> at
> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:56)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultURLArti factProcessorExtensionPoint$LazyURLArtifactProcessor.read(De faultURLArtifactProcessorExtensionPoint.java:222)
>
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:57)
>
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:55)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 55)
>
> ... 10 more
> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at
> org.apache.tuscany.sca.extensibility.ClassLoaderServiceDisco verer$ServiceDeclarationImpl.loadClass(ClassLoaderServiceDis coverer.java:88)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:376)
>
> ... 22 more
>
>
> and my version 2 app (cant find an SCADOmain.class in version 2 build -
> so did a google search and came up with somthing like this
> //demoV2SCA
> import org.apache.tuscany.sca.node.Client;
> import org.apache.tuscany.sca.node.Node;
> import org.apache.tuscany.sca.node.NodeFactory;
>
>
> public class demoV2Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
> NodeFactory nf = NodeFactory.newInstance();
>
> //String root =
> ContributionLocationHelper.getContributionLocation("HelloWorld ");
> //Contribution contribution = new Contribution(root, root);
>
> Node node = nf.createNode();
>
> System.out.println("start tuscany node \n");
> node.start();
> HelloWorld hello =
> ((Client)node).getService(HelloWorld.class, "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
> node.stop();
> }
>
>
> }
>
> which errors with
> Exception in thread "main" org.oasisopen.sca.ServiceRuntimeException: No
> SCA contributions are found on the classpath
> at
> org.apache.tuscany.sca.node.NodeFactory.createNode(NodeFacto ry.java:367)
> at demoV2Main.main(demoV2Main.java:25)
>
>
> so what am i doing wrong and how do i get a simple app up and running in
> eclipse
>
> Any help greatfully received - i have got stuck i think
>


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483449 is a reply to message #483436] Tue, 01 September 2009 15:55 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Hi,

I think that it's a classpath problem.
> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
Try to add neethi?.jar in your classpath. You can find it in tuscany/lib/
The best way to begin is to add all the libraries of Tuscany in your
classpath.

As Vincent said, you can also use the deployment tool [0]

Regards,

Stephane Drapeau
Obeo

[0]:
http://wiki.eclipse.org/STP/SCA_Component/SCA_Java_Run_and_D ebug_Tuscany



Vincent Zurczak a écrit :
> Hi William,
>
> For Tuscany 2.x, an exception would be normal, as it is not yet
> supported. I started to work on it but I could not find time to finish it.
>
> So, deploying an SCA application with SCA Tools can only be done with
> Tuscany 1.x for the moment.
>
> For Tuscany 1.5, and given the exception you got, it seems it is an
> error in your SCA application and not in the deployment tool. The
> deployment tool creates a client smilar to the one you wrote below
> (demoV1Main).
>
> What happens if you remove the sawsdl annotations from your composite?
> Does it solve the problem?
>
> About Tuscany 2, I think it is related to the OASIS namespace, which is
> not yet covered by the released SCA Tools. It is on the roadmap. You
> should replace the "sca" namespace in your composite by the OASIS one
> (it must be available in the samples running on Tuscany 2).
>
>
> Let me know if it helps.
>
>
> Vincent.
>
>
>
>
> William Woodman a écrit :
>> newbie here wonder if someone can help
>>
>> I have gallileo with stp 2.0.0.9 and 1.6.13 java vm
>>
>> i have downloaded v1.5 and v2 m3 tuscany binarys and installed on
>> harddrive.
>>
>> have created two user librarries in eclipse tuscnay v1 libs - pointed
>> at tuscany 1.5/lib/tuscany_sca_all.jar
>>
>> and tuscany v2 libs - pointed to tuscany v2m3/module/*.jar (cant find
>> a /lib directory in V2 at all - is that intentional??)
>>
>> created two user projects for "hello world" app quick test
>> used the sca editor to create demoSCA.composite as follows in both v1
>> and v2 apps
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
>> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
>> targetNamespace="http://eclipse.org/demoSCA/demoSCA">
>> <sca:component name="HelloWorldComponent">
>> <sca:implementation.java class="HelloWorldImpl"/>
>> <sca:service name="helloWorld">
>> <sca:interface.java interface="HelloWorld"/>
>> <sawsdl:semantic.sawsdl/>
>> </sca:service>
>> <sawsdl:semantic.sawsdl/>
>> </sca:component>
>> <sca:service name="helloWorld" promote="HelloWorldComponent/helloWorld">
>> <sca:interface.java interface="HelloWorld"/>
>> </sca:service>
>> </sca:composite>
>>
>> I have a simple interface (HelloWorld.java) marked as @Remotable (one
>> method)
>>
>> and a simple implementation marked with @Service (HelloWorld.class)
>> which just returns a String
>>
>> I have standalone client class to drive the simple project
>> import org.apache.tuscany.sca.host.embedded.SCADomain;
>>
>> //demoV1SCA.java
>> public class demoV1Main {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>> //create new Tuscany node
>> System.out.println("starting new domain\n");
>>
>> // Locate the service using SCA APIs
>> SCADomain domain = SCADomain.newInstance("demoSCA");
>> System.out.println("lookup service\n");
>> HelloWorld hello = domain.getService(HelloWorld.class,
>> "HelloWorld");
>> // Calculate
>> System.out.println("say " + hello.helloWorld());
>> try
>> {
>> System.in.read();
>> } catch (Exception e)
>> {
>> System.exit(0);
>> }
>>
>> SCADomain.removeInstance(domain);
>> }
>>
>>
>> }
>>
>> when i run this as an applicaqtion it errors with
>> starting new domain
>>
>> 01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.NodeImpl <init>
>> INFO: Creating node: demoSCA
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator
>> start
>> WARNING: Class proxys not supported due to
>> NoClassDefFoundError:net/sf/cglib/proxy/Callback
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
>> WARNING: Exception starting module
>> org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator
>> :org/apache/axiom/om/OMElement
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
>> WARNING: Exception starting module
>> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
>> :javax/servlet/ServletException
>> 01-Sep-2009 14:05:50
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor
>>
>> SEVERE: IllegalStateException
>> Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
>> org.apache.tuscany.sca.core.assembly.ActivationException:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
>> at
>> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANo deFromClassLoader(NodeFactoryImpl.java:37)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.i nit(DefaultSCADomain.java:178)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init >(DefaultSCADomain.java:100)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.SCADomain.createNewInst ance(SCADomain.java:182)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(S CADomain.java:63)
>>
>> at demoV1Main.main(demoV1Main.java:22)
>> Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:305)
>>
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.start(R untimeBootStrapper.java:187)
>>
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.initRuntime(NodeIm pl.java:465)
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:193)
>> ... 6 more
>> Caused by:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 61)
>>
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:278)
>>
>> ... 9 more
>> Caused by: java.lang.IllegalStateException:
>> java.lang.ClassNotFoundException: org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:378)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.addArtifactProcessor(DefaultStA XArtifactProcessorExtensionPoint.java:103)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.loadArtifactProcessors(DefaultS tAXArtifactProcessorExtensionPoint.java:191)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:125)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:56)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.ExtensibleStAX ArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java: 136)
>>
>> at
>> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:156)
>>
>> at
>> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:56)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultURLArti factProcessorExtensionPoint$LazyURLArtifactProcessor.read(De faultURLArtifactProcessorExtensionPoint.java:222)
>>
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:57)
>>
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:55)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 55)
>>
>> ... 10 more
>> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> at
>> org.apache.tuscany.sca.extensibility.ClassLoaderServiceDisco verer$ServiceDeclarationImpl.loadClass(ClassLoaderServiceDis coverer.java:88)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:376)
>>
>> ... 22 more
>>
>>
>> and my version 2 app (cant find an SCADOmain.class in version 2 build
>> - so did a google search and came up with somthing like this
>> //demoV2SCA
>> import org.apache.tuscany.sca.node.Client;
>> import org.apache.tuscany.sca.node.Node;
>> import org.apache.tuscany.sca.node.NodeFactory;
>>
>>
>> public class demoV2Main {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>> //create new Tuscany node NodeFactory nf =
>> NodeFactory.newInstance();
>> //String root =
>> ContributionLocationHelper.getContributionLocation("HelloWorld ");
>> //Contribution contribution = new Contribution(root, root);
>>
>> Node node = nf.createNode();
>>
>> System.out.println("start tuscany node \n");
>> node.start();
>> HelloWorld hello =
>> ((Client)node).getService(HelloWorld.class, "HelloWorld");
>> // Calculate
>> System.out.println("say " + hello.helloWorld());
>> try
>> {
>> System.in.read();
>> } catch (Exception e)
>> {
>> System.exit(0);
>> }
>> node.stop();
>> }
>>
>>
>> }
>>
>> which errors with
>> Exception in thread "main" org.oasisopen.sca.ServiceRuntimeException:
>> No SCA contributions are found on the classpath
>> at
>> org.apache.tuscany.sca.node.NodeFactory.createNode(NodeFacto ry.java:367)
>> at demoV2Main.main(demoV2Main.java:25)
>>
>>
>> so what am i doing wrong and how do i get a simple app up and running
>> in eclipse
>>
>> Any help greatfully received - i have got stuck i think
>>
>
>
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483586 is a reply to message #483399] Wed, 02 September 2009 09:00 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
okay - thanks for the reply - some little movement now.

1st neethi jars - I had only included the tuscany_sca_all.jar in the lib build

so idependtly i did a search in findJAR.com and found the apache neethi project and downloaded it from there - i'll now go back and tidy up and us the version in the tuscany distro - but its the same jar so that works okay.

next problem i ran into was it couldnt find a RunAs class - did a findJAR on that and hit on the jboss-ejb3x jar - when i included that in the build path and ran it it seems to come up

however my last problem seems to be (in my v1 example) that the it cant find my service - not quite sure why

heres the latest composite def ( ihad to manually remove the <sawsdl> that the gallileo editor puts in and then the tuscany engine domain would come up.)

<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://demoV2SCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:interface.java interface="HelloWorld"/>
</sca:service>
</sca:composite>

and client code looks like



public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node


System.out.println("starting new domain\n");

// Locate the service using SCA APIs
SCADomain domain = SCADomain.newInstance("resource/demoSCA.composite");

System.out.println("lookup service\n");
HelloWorld hello = domain.getService(HelloWorld.class, "HelloWorld");


// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

SCADomain.removeInstance(domain);
}


}

error i get is my service not been contibuted to the domain - see below.

not sure what i have done wrong here. What do i need to add to let it parse the service and add to the registry so the lookup code can locate it ?




02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: resource/demoSCA.composite
02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
WARNING: Exception starting module org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator :org/apache/axiom/om/OMElement
02-Sep-2009 09:24:37 org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator start
WARNING: Class proxys not supported due to NoClassDefFoundError:net/sf/cglib/proxy/Callback
02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
WARNING: Exception starting module org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator :javax/servlet/ServletException
02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: resource/demoSCA.composite
Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1Main.main(demoV1Main.java:25)


---

lastly re the version 2 stuff - i tried changing the XML name space to the correct one for version 2 but the validator in the eclipse project wont accept it and marks it as faulty and therefore the build wont complete. thus until the soa tools is upgraded i cant do it as an SCA tools project. I could try a manual java project i guess and see what happens - might try that when i get the problems ironed out of the version 1 demo

thanks Will
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483609 is a reply to message #483586] Wed, 02 September 2009 10:23 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Why are you looking for a class named RunAs? "Run as" is an action that
you can launch when you right click on a composite file to run your SCA
application. To simplify, this action replaces the code you wrote in
your main method.

Anyway, I think you still have a problem with your classpath.

> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback

Have you added *all* the jar that are in the directory named *lib* of
Tuscany 1.5? This page, [0], describes how to set up Tuscany in your
environment.

Moreover, the composite file must be in your classpath.

Regards,

Stephane Drapeau
Obeo

[0]:
http://wiki.eclipse.org/STP/SCA_Component/SCA_First_Steps_Wi th_Composite_Designer#Set_up_Eclipse_for_Tuscany


William Woodman a écrit :
> okay - thanks for the reply - some little movement now.
>
> 1st neethi jars - I had only included the tuscany_sca_all.jar in the lib
> build
> so idependtly i did a search in findJAR.com and found the apache neethi
> project and downloaded it from there - i'll now go back and tidy up and
> us the version in the tuscany distro - but its the same jar so that
> works okay.
>
> next problem i ran into was it couldnt find a RunAs class - did a
> findJAR on that and hit on the jboss-ejb3x jar - when i included that in
> the build path and ran it it seems to come up
> however my last problem seems to be (in my v1 example) that the it cant
> find my service - not quite sure why
> heres the latest composite def ( ihad to manually remove the <sawsdl>
> that the gallileo editor puts in and then the tuscany engine domain
> would come up.)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://demoV2SCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
> <sca:interface.java interface="HelloWorld"/>
> </sca:service>
> </sca:composite>
>
> and client code looks like
>
>
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain =
> SCADomain.newInstance("resource/demoSCA.composite");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
> error i get is my service not been contibuted to the domain - see below.
>
> not sure what i have done wrong here. What do i need to add to let it
> parse the service and add to the registry so the lookup code can locate
> it ?
>
>
>
> 02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: resource/demoSCA.composite
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.core.databinding.module.DataBindingMo
> duleActivator :org/apache/axiom/om/OMElement
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.implementation.java.module.JavaRuntim
> eModuleActivator start
> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
> :javax/servlet/ServletException
> 02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
> 02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: resource/demoSCA.composite
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1Main.main(demoV1Main.java:25)
>
>
> ---
> lastly re the version 2 stuff - i tried changing the XML name space to
> the correct one for version 2 but the validator in the eclipse project
> wont accept it and marks it as faulty and therefore the build wont
> complete. thus until the soa tools is upgraded i cant do it as an SCA
> tools project. I could try a manual java project i guess and see what
> happens - might try that when i get the problems ironed out of the
> version 1 demo
>
> thanks Will
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483677 is a reply to message #483399] Wed, 02 September 2009 14:52 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member


i've attached a picture of my eclipse project tree.

Ive done two variants -

one with the composite file in src/resources dir

and one just top level with no substructure.

eclipse wont let you add src/resources to class path as top level src is all ready in.

either way i get this same error about the contribution

starting new domain

02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: demoSCA.composite
02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
02-Sep-2009 15:37:19 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: demoSCA.composite
lookup service

Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1Main.main(demoV1Main.java:25)

what exactly in SCA terms is a contribution ?



here is my latest .composite file

<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://eclipse.org/demoV1_1SCA/src/resources/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
</sca:composite>

have i got this right now? thanks in advance
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483728 is a reply to message #483677] Wed, 02 September 2009 17:58 Go to previous messageGo to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,

In your client, you have written

> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA");


Can you check what happens if you replace it by

> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA.composite");


On the link Stéphane pointed to, the composite extension is provided in
the new instance argument. If the composite is in the "src" folder of
your project, the service should be found.



Vincent.




William Woodman a écrit :
>
>
> i've attached a picture of my eclipse project tree.
>
> Ive done two variants -
> one with the composite file in src/resources dir
> and one just top level with no substructure.
>
> eclipse wont let you add src/resources to class path as top level src is
> all ready in.
>
> either way i get this same error about the contribution
> starting new domain
>
> 02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: demoSCA.composite
> 02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
> 02-Sep-2009 15:37:19 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: demoSCA.composite
> lookup service
>
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1Main.main(demoV1Main.java:25)
>
> what exactly in SCA terms is a contribution ?
>
>
> here is my latest .composite file
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://eclipse.org/demoV1_1SCA/src/resources/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
> </sca:composite>
>
> have i got this right now? thanks in advance


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483829 is a reply to message #483399] Thu, 03 September 2009 09:32 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
vincent - thanks for all the help so far but its doesnt seem to work

I have attached both eclipse projects as a zip (see attched) on the hope that you may be able to see the silly mistake

they are essentially the same code

v1 has all the .composite, and code files at top level /src

the v1_1 version has the .composite beneath resources and for good measure built a contributions.xml in META-INF to tell it the composite to load intio the domain

both report the same error when i run the samples

Heres to hoping you can see something silly i am doing wrong. I even tried to add a binding.sca to the composites top level service - but that didnt work either.

as mentioned at top of the stack i am using tuscany1.5, and java 1.6.13

regards in advance Will Sad

03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: resource/demoSCA.composite
03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1_1SCA/bin/
03-Sep-2009 10:17:48 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: resource/demoSCA.composite
lookup service

Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1_1Main.main(demoV1_1Main.java:25)


Confused
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483842 is a reply to message #483829] Thu, 03 September 2009 10:37 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Will,

There is no file attached. Could you please attach it? (only the project
that contains your test with Tuscany 1.5)

Thanks,

Stephane Drapeau
Obeo

William Woodman a écrit :
> vincent - thanks for all the help so far but its doesnt seem to work
>
> I have attached both eclipse projects as a zip (see attched) on the hope
> that you may be able to see the silly mistake
>
> they are essentially the same code
> v1 has all the .composite, and code files at top level /src
>
> the v1_1 version has the .composite beneath resources and for good
> measure built a contributions.xml in META-INF to tell it the composite
> to load intio the domain
> both report the same error when i run the samples
> Heres to hoping you can see something silly i am doing wrong. I even
> tried to add a binding.sca to the composites top level service - but
> that didnt work either.
>
> as mentioned at top of the stack i am using tuscany1.5, and java 1.6.13
>
> regards in advance Will :(
> 03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: resource/demoSCA.composite
> 03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1_1SCA/bin/
> 03-Sep-2009 10:17:48 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: resource/demoSCA.composite
> lookup service
>
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1_1Main.main(demoV1_1Main.java:25)
>
>
> :?
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483854 is a reply to message #483842] Thu, 03 September 2009 11:50 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
I hope that worked - i've tried to attached and uploaded - however there no real indication of success.

just incase heres the copies of simplest version (all at top level /src ) (project called demoV1SCA in eclipse)

demoSCA.composite :
<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://will.org/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
</sca:composite>

client to start the test
demoV1Main.java
import org.apache.tuscany.sca.host.embedded.SCADomain;

public class demoV1Main
{

/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node


System.out.println("starting new domain\n");

// Locate the service using SCA APIs
SCADomain domain = SCADomain.newInstance("demoSCA.composite");

System.out.println("lookup service\n");
HelloWorld hello = domain.getService(HelloWorld.class, "HelloWorld");


// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

SCADomain.removeInstance(domain);
}


}


HelloWorld.java - interface spec
import org.osoa.sca.annotations.*;

@Remotable

public interface HelloWorld
{

String helloWorld ();

}


HelloWorldImpl.java - component implementation

import org.osoa.sca.annotations.*;

@Service (HelloWorld.class)
@Scope ("COMPOSITE")

public class HelloWorldImpl implements HelloWorld
{
public String helloWorld ()
{
return "hello William";
}
}


.classpath setting in gallileo eclipse project
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/JavaSE-1.6 "/>
<classpathentry kind="lib" path=" C:/eclipse/eclipse/plugins/org.eclipse.stp.sca.osoa.java_2.0 .0.200906170710.jar "/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/tuscany v1 libs"/>
<classpathentry kind="output" path="bin"/>
</classpath>

help that helps show what i have
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483867 is a reply to message #483854] Thu, 03 September 2009 12:38 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Looking at your code, I think that your error comes from the second
attribute of the getService method.

> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");

You're right, the second attribute is the name of the service, but you
must write it as "component name/service name".
As the component has only one service, you can also use only the
component name.

So try:
HelloWorld hello = domain.getService(HelloWorld.class,
"HelloWorldComponent/HelloWorld");

or
HelloWorld hello = domain.getService(HelloWorld.class,
"HelloWorldComponent");


Stephane Drapeau
Obeo


William Woodman a écrit :
> I hope that worked - i've tried to attached and uploaded - however there
> no real indication of success.
>
> just incase heres the copies of simplest version (all at top level /src
> ) (project called demoV1SCA in eclipse)
>
> demoSCA.composite :
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://will.org/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
> </sca:composite>
>
> client to start the test demoV1Main.java
> import org.apache.tuscany.sca.host.embedded.SCADomain;
>
> public class demoV1Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA.composite");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
>
> HelloWorld.java - interface spec import org.osoa.sca.annotations.*;
>
> @Remotable
>
> public interface HelloWorld {
>
> String helloWorld ();
>
> }
>
>
> HelloWorldImpl.java - component implementation
> import org.osoa.sca.annotations.*;
>
> @Service (HelloWorld.class)
> @Scope ("COMPOSITE")
>
> public class HelloWorldImpl implements HelloWorld
> {
> public String helloWorld ()
> {
> return "hello William";
> }
> }
>
>
> classpath setting in gallileo eclipse project
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
> <classpathentry kind="src" path="src"/>
> <classpathentry kind="con" path="
> org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte
> rnal.debug.ui.launcher.StandardVMType/JavaSE-1.6 "/>
> <classpathentry kind="lib" path="
> C:/eclipse/eclipse/plugins/org.eclipse.stp.sca.osoa.java_2.0
> .0.200906170710.jar "/>
> <classpathentry kind="con"
> path="org.eclipse.jdt.USER_LIBRARY/tuscany v1 libs"/>
> <classpathentry kind="output" path="bin"/>
> </classpath>
>
> help that helps show what i have
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483904 is a reply to message #483867] Thu, 03 September 2009 14:43 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
Stephanie thanks for that seems a bit weird but it worked this time .

query really on hiding the details. by having to specify
domain.getService(HelloWorld.class, "HelloWorldComponent/HelloWorld")

the client has to understand which component in the composite offers the service - and that should surely be explicit from the service defn on the composite and the promotion/wiring details in the scdl file.

whys does a client have to know the component - when all they are transacting is with the retuerned service (a interface proxy)

seems weird - is there a good reason for this in the SCA specs?

however thanks for getting me started - it was beginningt to drive me not so slowly nuts

Will Razz
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483926 is a reply to message #483904] Thu, 03 September 2009 15:51 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
one more question on same area.

tried to now expose the service as a web service - i followed the example in the tuscany basic user guide - however the expected response doesnt come back

modified the scdl spec as follows


<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="demoSCA"
targetNamespace="http://will.org/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:binding.ws uri="http://localhost:8080/HelloWorld"/>
<sca:binding.sca/>
</sca:service>
</sca:composite>

this starts up okay - but when i point the browser a the URI

http://localhost:8080/HelloWorld?/wsdl

i get the following where the targetNamespace is "", and i get an error i cant see off to the right


//browser response cut and paste
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


------------------------------------------------------------ --------------------

The operation completed successfully. Error processing resource 'http://localhost:8080/HelloWorld?wsdl'. Line 2, Position ...

<wsdl:definitions name="HelloWorldService" targetNamespace="" xmlns:tns="" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ...


Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483933 is a reply to message #483904] Thu, 03 September 2009 16:19 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
From my point of view, this is not a problem that comes from the SCA
specifications. I think that the getService method provided by Tuscany
has a bug.
getService(HelloWorld.class, "HelloWorld") should work if HelloWorld is
promoted in the composite.
Better to ask directly to the Tuscany community.

Stephane Drapeau
Obeo


William Woodman a écrit :
> Stephanie thanks for that seems a bit weird but it worked this time .
>
> query really on hiding the details. by having to specify
> domain.getService(HelloWorld.class, "HelloWorldComponent/HelloWorld")
>
> the client has to understand which component in the composite offers the
> service - and that should surely be explicit from the service defn on
> the composite and the promotion/wiring details in the scdl file.
> whys does a client have to know the component - when all they are
> transacting is with the retuerned service (a interface proxy)
> seems weird - is there a good reason for this in the SCA specs?
>
> however thanks for getting me started - it was beginningt to drive me
> not so slowly nuts
> Will :p
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #483945 is a reply to message #483933] Thu, 03 September 2009 17:28 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
Stepanie

thanks for that i'll check with the tuscany guys -

however have you any idea why my web service doesnt work properly - see previous post?

Will

Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #484078 is a reply to message #483945] Fri, 04 September 2009 08:40 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Will,

Have you defined your service interface in a Java package?
If not, move the interface in a package named "test" for example.
Tuscany computes namespaces of the generated WSDL from the Java package
names.

I hope this will help you.

Stephane Drapeau
Obeo

William Woodman a écrit :
> Stepanie
>
> thanks for that i'll check with the tuscany guys -
> however have you any idea why my web service doesnt work properly - see
> previous post?
>
> Will
>
>
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #484152 is a reply to message #484078] Fri, 04 September 2009 13:01 Go to previous messageGo to next message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
stephanie

nearly there i think. I did what you suggested,

i created some directory structure for my interface and the implementation code in a directory will/org/helloWorld below the eclipse src file.

put the exlpicit package statement at the top of the source files - like this for the interface

package will.org.helloWorld;

import org.osoa.sca.annotations.*;

@Remotable

public interface HelloWorld
{

String helloWorld ();

}

i modified the .composite file as follows to put in the fully qualified path (i also set the targetNamespace to be the same for good measure

<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="demoSCA"
targetNamespace="http://will.org.helloWorld">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="will.org.helloWorld.HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:binding.ws uri="http://localhost:8080/HelloWorld"/>
<sca:binding.sca/>
</sca:service>
</sca:composite>

I then re ran the test and pointed the browser at the URI and whoopee as you suggested the wsdl is now aautomagically generated.

whats wierd is that the generated targetNamespace in the WSDL is the Reverse of my source path i.e. http://helloWorld.org.will

is that what it should do ? i'd have expected it to come out like in the same order as the path. Is this just another ideosyncratic tuscany v1.5 ' feature' or as expected?

generated WSDL

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="HelloWorldService" targetNamespace="http://helloWorld.org.will/" xmlns:tns="http://helloWorld.org.will/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/">
- <wsdl:types>
- <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://helloWorld.org.will/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="helloWorld">
<xs:complexType />
</xs:element>
- <xs:element name="helloWorldResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
- <wsdl:message name="helloWorld">
<wsdl:part name="helloWorld" element="tns:helloWorld" />
</wsdl:message>
- <wsdl:message name="helloWorldResponse">
<wsdl:part name="helloWorldResponse" element="tns:helloWorldResponse" />
</wsdl:message>
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="helloWorld">
<wsdl:input message="tns:helloWorld" />
<wsdl:output message="tns:helloWorldResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="HelloWorldBinding" type="tns:HelloWorld">
<SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="helloWorld">
<SOAP:operation />
- <wsdl:input>
<SOAP:body use="literal" />
</wsdl:input>
- <wsdl:output>
<SOAP:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="HelloWorldService">
- <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">
<SOAP:address location="http://10.215.2.56:8080/HelloWorld" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

thanks one more time in advance
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #484187 is a reply to message #484152] Fri, 04 September 2009 14:21 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,


William Woodman a écrit :

> whats wierd is that the generated targetNamespace in the WSDL is the
> Reverse of my source path i.e. http://helloWorld.org.will
>
> is that what it should do ? i'd have expected it to come out like in
> the same order as the path. Is this just another ideosyncratic tuscany
> v1.5 ' feature' or as expected?


Yes, it is normal.
When mapping Java to XML (and vice-versa), Java package names are
written in the reversed order to generate the target namespace.


Vincent.


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576056 is a reply to message #483399] Tue, 01 September 2009 15:39 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,

For Tuscany 2.x, an exception would be normal, as it is not yet
supported. I started to work on it but I could not find time to finish it.

So, deploying an SCA application with SCA Tools can only be done with
Tuscany 1.x for the moment.

For Tuscany 1.5, and given the exception you got, it seems it is an
error in your SCA application and not in the deployment tool. The
deployment tool creates a client smilar to the one you wrote below
(demoV1Main).

What happens if you remove the sawsdl annotations from your composite?
Does it solve the problem?

About Tuscany 2, I think it is related to the OASIS namespace, which is
not yet covered by the released SCA Tools. It is on the roadmap. You
should replace the "sca" namespace in your composite by the OASIS one
(it must be available in the samples running on Tuscany 2).


Let me know if it helps.


Vincent.




William Woodman a écrit :
> newbie here wonder if someone can help
>
> I have gallileo with stp 2.0.0.9 and 1.6.13 java vm
>
> i have downloaded v1.5 and v2 m3 tuscany binarys and installed on
> harddrive.
>
> have created two user librarries in eclipse tuscnay v1 libs - pointed at
> tuscany 1.5/lib/tuscany_sca_all.jar
>
> and tuscany v2 libs - pointed to tuscany v2m3/module/*.jar (cant find a
> /lib directory in V2 at all - is that intentional??)
>
> created two user projects for "hello world" app quick test
> used the sca editor to create demoSCA.composite as follows in both v1
> and v2 apps
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://eclipse.org/demoSCA/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="helloWorld">
> <sca:interface.java interface="HelloWorld"/>
> <sawsdl:semantic.sawsdl/>
> </sca:service>
> <sawsdl:semantic.sawsdl/>
> </sca:component>
> <sca:service name="helloWorld" promote="HelloWorldComponent/helloWorld">
> <sca:interface.java interface="HelloWorld"/>
> </sca:service>
> </sca:composite>
>
> I have a simple interface (HelloWorld.java) marked as @Remotable (one
> method)
>
> and a simple implementation marked with @Service (HelloWorld.class)
> which just returns a String
>
> I have standalone client class to drive the simple project
> import org.apache.tuscany.sca.host.embedded.SCADomain;
>
> //demoV1SCA.java
> public class demoV1Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
> when i run this as an applicaqtion it errors with
> starting new domain
>
> 01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: demoSCA
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator
> start
> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator
> :org/apache/axiom/om/OMElement
> 01-Sep-2009 14:05:49
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
> :javax/servlet/ServletException
> 01-Sep-2009 14:05:50
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor
>
> SEVERE: IllegalStateException
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
> org.apache.tuscany.sca.core.assembly.ActivationException:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
> at
> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANo deFromClassLoader(NodeFactoryImpl.java:37)
>
> at
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.i nit(DefaultSCADomain.java:178)
>
> at
> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init >(DefaultSCADomain.java:100)
>
> at
> org.apache.tuscany.sca.host.embedded.SCADomain.createNewInst ance(SCADomain.java:182)
>
> at
> org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(S CADomain.java:63)
>
> at demoV1Main.main(demoV1Main.java:22)
> Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:305)
>
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.start(R untimeBootStrapper.java:187)
>
> at
> org.apache.tuscany.sca.node.impl.NodeImpl.initRuntime(NodeIm pl.java:465)
> at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:193)
> ... 6 more
> Caused by:
> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
> org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 61)
>
> at
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:278)
>
> ... 9 more
> Caused by: java.lang.IllegalStateException:
> java.lang.ClassNotFoundException: org.apache.neethi.Policy
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:378)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.addArtifactProcessor(DefaultStA XArtifactProcessorExtensionPoint.java:103)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.loadArtifactProcessors(DefaultS tAXArtifactProcessorExtensionPoint.java:191)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:125)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:56)
>
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAX ArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java: 136)
>
> at
> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:156)
>
> at
> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:56)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultURLArti factProcessorExtensionPoint$LazyURLArtifactProcessor.read(De faultURLArtifactProcessorExtensionPoint.java:222)
>
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:57)
>
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:55)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 55)
>
> ... 10 more
> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at
> org.apache.tuscany.sca.extensibility.ClassLoaderServiceDisco verer$ServiceDeclarationImpl.loadClass(ClassLoaderServiceDis coverer.java:88)
>
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:376)
>
> ... 22 more
>
>
> and my version 2 app (cant find an SCADOmain.class in version 2 build -
> so did a google search and came up with somthing like this
> //demoV2SCA
> import org.apache.tuscany.sca.node.Client;
> import org.apache.tuscany.sca.node.Node;
> import org.apache.tuscany.sca.node.NodeFactory;
>
>
> public class demoV2Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
> NodeFactory nf = NodeFactory.newInstance();
>
> //String root =
> ContributionLocationHelper.getContributionLocation("HelloWorld ");
> //Contribution contribution = new Contribution(root, root);
>
> Node node = nf.createNode();
>
> System.out.println("start tuscany node \n");
> node.start();
> HelloWorld hello =
> ((Client)node).getService(HelloWorld.class, "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
> node.stop();
> }
>
>
> }
>
> which errors with
> Exception in thread "main" org.oasisopen.sca.ServiceRuntimeException: No
> SCA contributions are found on the classpath
> at
> org.apache.tuscany.sca.node.NodeFactory.createNode(NodeFacto ry.java:367)
> at demoV2Main.main(demoV2Main.java:25)
>
>
> so what am i doing wrong and how do i get a simple app up and running in
> eclipse
>
> Any help greatfully received - i have got stuck i think
>


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576081 is a reply to message #483436] Tue, 01 September 2009 15:55 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Hi,

I think that it's a classpath problem.
> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
Try to add neethi?.jar in your classpath. You can find it in tuscany/lib/
The best way to begin is to add all the libraries of Tuscany in your
classpath.

As Vincent said, you can also use the deployment tool [0]

Regards,

Stephane Drapeau
Obeo

[0]:
http://wiki.eclipse.org/STP/SCA_Component/SCA_Java_Run_and_D ebug_Tuscany



Vincent Zurczak a écrit :
> Hi William,
>
> For Tuscany 2.x, an exception would be normal, as it is not yet
> supported. I started to work on it but I could not find time to finish it.
>
> So, deploying an SCA application with SCA Tools can only be done with
> Tuscany 1.x for the moment.
>
> For Tuscany 1.5, and given the exception you got, it seems it is an
> error in your SCA application and not in the deployment tool. The
> deployment tool creates a client smilar to the one you wrote below
> (demoV1Main).
>
> What happens if you remove the sawsdl annotations from your composite?
> Does it solve the problem?
>
> About Tuscany 2, I think it is related to the OASIS namespace, which is
> not yet covered by the released SCA Tools. It is on the roadmap. You
> should replace the "sca" namespace in your composite by the OASIS one
> (it must be available in the samples running on Tuscany 2).
>
>
> Let me know if it helps.
>
>
> Vincent.
>
>
>
>
> William Woodman a écrit :
>> newbie here wonder if someone can help
>>
>> I have gallileo with stp 2.0.0.9 and 1.6.13 java vm
>>
>> i have downloaded v1.5 and v2 m3 tuscany binarys and installed on
>> harddrive.
>>
>> have created two user librarries in eclipse tuscnay v1 libs - pointed
>> at tuscany 1.5/lib/tuscany_sca_all.jar
>>
>> and tuscany v2 libs - pointed to tuscany v2m3/module/*.jar (cant find
>> a /lib directory in V2 at all - is that intentional??)
>>
>> created two user projects for "hello world" app quick test
>> used the sca editor to create demoSCA.composite as follows in both v1
>> and v2 apps
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
>> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
>> targetNamespace="http://eclipse.org/demoSCA/demoSCA">
>> <sca:component name="HelloWorldComponent">
>> <sca:implementation.java class="HelloWorldImpl"/>
>> <sca:service name="helloWorld">
>> <sca:interface.java interface="HelloWorld"/>
>> <sawsdl:semantic.sawsdl/>
>> </sca:service>
>> <sawsdl:semantic.sawsdl/>
>> </sca:component>
>> <sca:service name="helloWorld" promote="HelloWorldComponent/helloWorld">
>> <sca:interface.java interface="HelloWorld"/>
>> </sca:service>
>> </sca:composite>
>>
>> I have a simple interface (HelloWorld.java) marked as @Remotable (one
>> method)
>>
>> and a simple implementation marked with @Service (HelloWorld.class)
>> which just returns a String
>>
>> I have standalone client class to drive the simple project
>> import org.apache.tuscany.sca.host.embedded.SCADomain;
>>
>> //demoV1SCA.java
>> public class demoV1Main {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>> //create new Tuscany node
>> System.out.println("starting new domain\n");
>>
>> // Locate the service using SCA APIs
>> SCADomain domain = SCADomain.newInstance("demoSCA");
>> System.out.println("lookup service\n");
>> HelloWorld hello = domain.getService(HelloWorld.class,
>> "HelloWorld");
>> // Calculate
>> System.out.println("say " + hello.helloWorld());
>> try
>> {
>> System.in.read();
>> } catch (Exception e)
>> {
>> System.exit(0);
>> }
>>
>> SCADomain.removeInstance(domain);
>> }
>>
>>
>> }
>>
>> when i run this as an applicaqtion it errors with
>> starting new domain
>>
>> 01-Sep-2009 14:05:49 org.apache.tuscany.sca.node.impl.NodeImpl <init>
>> INFO: Creating node: demoSCA
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator
>> start
>> WARNING: Class proxys not supported due to
>> NoClassDefFoundError:net/sf/cglib/proxy/Callback
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
>> WARNING: Exception starting module
>> org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator
>> :org/apache/axiom/om/OMElement
>> 01-Sep-2009 14:05:49
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
>> WARNING: Exception starting module
>> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
>> :javax/servlet/ServletException
>> 01-Sep-2009 14:05:50
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor
>>
>> SEVERE: IllegalStateException
>> Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
>> org.apache.tuscany.sca.core.assembly.ActivationException:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:200)
>> at
>> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createSCANo deFromClassLoader(NodeFactoryImpl.java:37)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.i nit(DefaultSCADomain.java:178)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init >(DefaultSCADomain.java:100)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.SCADomain.createNewInst ance(SCADomain.java:182)
>>
>> at
>> org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(S CADomain.java:63)
>>
>> at demoV1Main.main(demoV1Main.java:22)
>> Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:305)
>>
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.start(R untimeBootStrapper.java:187)
>>
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.initRuntime(NodeIm pl.java:465)
>> at
>> org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:193)
>> ... 6 more
>> Caused by:
>> org.apache.tuscany.sca.provider.SCADefinitionsProviderExcept ion:
>> java.lang.IllegalStateException: java.lang.ClassNotFoundException:
>> org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 61)
>>
>> at
>> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper.loadSCA Definitions(RuntimeBootStrapper.java:278)
>>
>> ... 9 more
>> Caused by: java.lang.IllegalStateException:
>> java.lang.ClassNotFoundException: org.apache.neethi.Policy
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:378)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.addArtifactProcessor(DefaultStA XArtifactProcessorExtensionPoint.java:103)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.loadArtifactProcessors(DefaultS tAXArtifactProcessorExtensionPoint.java:191)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:125)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint.getProcessor(DefaultStAXArtifac tProcessorExtensionPoint.java:56)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.ExtensibleStAX ArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java: 136)
>>
>> at
>> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:156)
>>
>> at
>> org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumen tProcessor.read(SCADefinitionsDocumentProcessor.java:56)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultURLArti factProcessorExtensionPoint$LazyURLArtifactProcessor.read(De faultURLArtifactProcessorExtensionPoint.java:222)
>>
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:57)
>>
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider$1.run(WSBindingDefinitionsProvider.java:55)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitions Provider.getSCADefinition(WSBindingDefinitionsProvider.java: 55)
>>
>> ... 10 more
>> Caused by: java.lang.ClassNotFoundException: org.apache.neethi.Policy
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301 )
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> at
>> org.apache.tuscany.sca.extensibility.ClassLoaderServiceDisco verer$ServiceDeclarationImpl.loadClass(ClassLoaderServiceDis coverer.java:88)
>>
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArt ifactProcessorExtensionPoint$LazyStAXArtifactProcessor.getMo delType(DefaultStAXArtifactProcessorExtensionPoint.java:376)
>>
>> ... 22 more
>>
>>
>> and my version 2 app (cant find an SCADOmain.class in version 2 build
>> - so did a google search and came up with somthing like this
>> //demoV2SCA
>> import org.apache.tuscany.sca.node.Client;
>> import org.apache.tuscany.sca.node.Node;
>> import org.apache.tuscany.sca.node.NodeFactory;
>>
>>
>> public class demoV2Main {
>>
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>> //create new Tuscany node NodeFactory nf =
>> NodeFactory.newInstance();
>> //String root =
>> ContributionLocationHelper.getContributionLocation("HelloWorld ");
>> //Contribution contribution = new Contribution(root, root);
>>
>> Node node = nf.createNode();
>>
>> System.out.println("start tuscany node \n");
>> node.start();
>> HelloWorld hello =
>> ((Client)node).getService(HelloWorld.class, "HelloWorld");
>> // Calculate
>> System.out.println("say " + hello.helloWorld());
>> try
>> {
>> System.in.read();
>> } catch (Exception e)
>> {
>> System.exit(0);
>> }
>> node.stop();
>> }
>>
>>
>> }
>>
>> which errors with
>> Exception in thread "main" org.oasisopen.sca.ServiceRuntimeException:
>> No SCA contributions are found on the classpath
>> at
>> org.apache.tuscany.sca.node.NodeFactory.createNode(NodeFacto ry.java:367)
>> at demoV2Main.main(demoV2Main.java:25)
>>
>>
>> so what am i doing wrong and how do i get a simple app up and running
>> in eclipse
>>
>> Any help greatfully received - i have got stuck i think
>>
>
>
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576101 is a reply to message #483399] Wed, 02 September 2009 09:00 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
okay - thanks for the reply - some little movement now.

1st neethi jars - I had only included the tuscany_sca_all.jar in the lib build

so idependtly i did a search in findJAR.com and found the apache neethi project and downloaded it from there - i'll now go back and tidy up and us the version in the tuscany distro - but its the same jar so that works okay.

next problem i ran into was it couldnt find a RunAs class - did a findJAR on that and hit on the jboss-ejb3x jar - when i included that in the build path and ran it it seems to come up

however my last problem seems to be (in my v1 example) that the it cant find my service - not quite sure why

heres the latest composite def ( ihad to manually remove the <sawsdl> that the gallileo editor puts in and then the tuscany engine domain would come up.)

<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://demoV2SCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:interface.java interface="HelloWorld"/>
</sca:service>
</sca:composite>

and client code looks like



public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node


System.out.println("starting new domain\n");

// Locate the service using SCA APIs
SCADomain domain = SCADomain.newInstance("resource/demoSCA.composite");

System.out.println("lookup service\n");
HelloWorld hello = domain.getService(HelloWorld.class, "HelloWorld");


// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

SCADomain.removeInstance(domain);
}


}

error i get is my service not been contibuted to the domain - see below.

not sure what i have done wrong here. What do i need to add to let it parse the service and add to the registry so the lookup code can locate it ?




02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: resource/demoSCA.composite
02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
WARNING: Exception starting module org.apache.tuscany.sca.core.databinding.module.DataBindingMo duleActivator :org/apache/axiom/om/OMElement
02-Sep-2009 09:24:37 org.apache.tuscany.sca.implementation.java.module.JavaRuntim eModuleActivator start
WARNING: Class proxys not supported due to NoClassDefFoundError:net/sf/cglib/proxy/Callback
02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
WARNING: Exception starting module org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator :javax/servlet/ServletException
02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: resource/demoSCA.composite
Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1Main.main(demoV1Main.java:25)


---

lastly re the version 2 stuff - i tried changing the XML name space to the correct one for version 2 but the validator in the eclipse project wont accept it and marks it as faulty and therefore the build wont complete. thus until the soa tools is upgraded i cant do it as an SCA tools project. I could try a manual java project i guess and see what happens - might try that when i get the problems ironed out of the version 1 demo

thanks Will
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576124 is a reply to message #576101] Wed, 02 September 2009 10:23 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Why are you looking for a class named RunAs? "Run as" is an action that
you can launch when you right click on a composite file to run your SCA
application. To simplify, this action replaces the code you wrote in
your main method.

Anyway, I think you still have a problem with your classpath.

> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback

Have you added *all* the jar that are in the directory named *lib* of
Tuscany 1.5? This page, [0], describes how to set up Tuscany in your
environment.

Moreover, the composite file must be in your classpath.

Regards,

Stephane Drapeau
Obeo

[0]:
http://wiki.eclipse.org/STP/SCA_Component/SCA_First_Steps_Wi th_Composite_Designer#Set_up_Eclipse_for_Tuscany


William Woodman a écrit :
> okay - thanks for the reply - some little movement now.
>
> 1st neethi jars - I had only included the tuscany_sca_all.jar in the lib
> build
> so idependtly i did a search in findJAR.com and found the apache neethi
> project and downloaded it from there - i'll now go back and tidy up and
> us the version in the tuscany distro - but its the same jar so that
> works okay.
>
> next problem i ran into was it couldnt find a RunAs class - did a
> findJAR on that and hit on the jboss-ejb3x jar - when i included that in
> the build path and ran it it seems to come up
> however my last problem seems to be (in my v1 example) that the it cant
> find my service - not quite sure why
> heres the latest composite def ( ihad to manually remove the <sawsdl>
> that the gallileo editor puts in and then the tuscany engine domain
> would come up.)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://demoV2SCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
> <sca:interface.java interface="HelloWorld"/>
> </sca:service>
> </sca:composite>
>
> and client code looks like
>
>
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain =
> SCADomain.newInstance("resource/demoSCA.composite");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
> error i get is my service not been contibuted to the domain - see below.
>
> not sure what i have done wrong here. What do i need to add to let it
> parse the service and add to the registry so the lookup code can locate
> it ?
>
>
>
> 02-Sep-2009 09:24:37 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: resource/demoSCA.composite
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.core.databinding.module.DataBindingMo
> duleActivator :org/apache/axiom/om/OMElement
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.implementation.java.module.JavaRuntim
> eModuleActivator start
> WARNING: Class proxys not supported due to
> NoClassDefFoundError:net/sf/cglib/proxy/Callback
> 02-Sep-2009 09:24:37
> org.apache.tuscany.sca.node.impl.RuntimeBootStrapper startModules
> WARNING: Exception starting module
> org.apache.tuscany.sca.http.jetty.module.JettyRuntimeModuleA ctivator
> :javax/servlet/ServletException
> 02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
> 02-Sep-2009 09:24:38 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: resource/demoSCA.composite
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1Main.main(demoV1Main.java:25)
>
>
> ---
> lastly re the version 2 stuff - i tried changing the XML name space to
> the correct one for version 2 but the validator in the eclipse project
> wont accept it and marks it as faulty and therefore the build wont
> complete. thus until the soa tools is upgraded i cant do it as an SCA
> tools project. I could try a manual java project i guess and see what
> happens - might try that when i get the problems ironed out of the
> version 1 demo
>
> thanks Will
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576156 is a reply to message #483399] Wed, 02 September 2009 14:52 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
i've attached a picture of my eclipse project tree.

Ive done two variants -

one with the composite file in src/resources dir

and one just top level with no substructure.

eclipse wont let you add src/resources to class path as top level src is all ready in.

either way i get this same error about the contribution

starting new domain

02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: demoSCA.composite
02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
02-Sep-2009 15:37:19 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: demoSCA.composite
lookup service

Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1Main.main(demoV1Main.java:25)

what exactly in SCA terms is a contribution ?



here is my latest .composite file

<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://eclipse.org/demoV1_1SCA/src/resources/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
</sca:composite>

have i got this right now? thanks in advance
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576175 is a reply to message #483677] Wed, 02 September 2009 17:58 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,

In your client, you have written

> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA");


Can you check what happens if you replace it by

> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA.composite");


On the link Stéphane pointed to, the composite extension is provided in
the new instance argument. If the composite is in the "src" folder of
your project, the service should be found.



Vincent.




William Woodman a écrit :
>
>
> i've attached a picture of my eclipse project tree.
>
> Ive done two variants -
> one with the composite file in src/resources dir
> and one just top level with no substructure.
>
> eclipse wont let you add src/resources to class path as top level src is
> all ready in.
>
> either way i get this same error about the contribution
> starting new domain
>
> 02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: demoSCA.composite
> 02-Sep-2009 15:37:17 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1SCA/bin/
> 02-Sep-2009 15:37:19 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: demoSCA.composite
> lookup service
>
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1Main.main(demoV1Main.java:25)
>
> what exactly in SCA terms is a contribution ?
>
>
> here is my latest .composite file
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://eclipse.org/demoV1_1SCA/src/resources/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
> </sca:composite>
>
> have i got this right now? thanks in advance


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576194 is a reply to message #483399] Thu, 03 September 2009 09:32 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
vincent - thanks for all the help so far but its doesnt seem to work

I have attached both eclipse projects as a zip (see attched) on the hope that you may be able to see the silly mistake

they are essentially the same code

v1 has all the .composite, and code files at top level /src

the v1_1 version has the .composite beneath resources and for good measure built a contributions.xml in META-INF to tell it the composite to load intio the domain

both report the same error when i run the samples

Heres to hoping you can see something silly i am doing wrong. I even tried to add a binding.sca to the composites top level service - but that didnt work either.

as mentioned at top of the stack i am using tuscany1.5, and java 1.6.13

regards in advance Will :(

03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl <init>
INFO: Creating node: resource/demoSCA.composite
03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/C:/documents%20and%20settings/802518659/workspace/demo V1_1SCA/bin/
03-Sep-2009 10:17:48 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: resource/demoSCA.composite
lookup service

Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The service HelloWorld has not been contributed to the domain
at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc e(NodeImpl.java:779)
at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp l.java:746)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g etService(DefaultSCADomain.java:227)
at demoV1_1Main.main(demoV1_1Main.java:25)


:?
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576208 is a reply to message #576194] Thu, 03 September 2009 10:37 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Will,

There is no file attached. Could you please attach it? (only the project
that contains your test with Tuscany 1.5)

Thanks,

Stephane Drapeau
Obeo

William Woodman a écrit :
> vincent - thanks for all the help so far but its doesnt seem to work
>
> I have attached both eclipse projects as a zip (see attched) on the hope
> that you may be able to see the silly mistake
>
> they are essentially the same code
> v1 has all the .composite, and code files at top level /src
>
> the v1_1 version has the .composite beneath resources and for good
> measure built a contributions.xml in META-INF to tell it the composite
> to load intio the domain
> both report the same error when i run the samples
> Heres to hoping you can see something silly i am doing wrong. I even
> tried to add a binding.sca to the composites top level service - but
> that didnt work either.
>
> as mentioned at top of the stack i am using tuscany1.5, and java 1.6.13
>
> regards in advance Will :(
> 03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: resource/demoSCA.composite
> 03-Sep-2009 10:17:47 org.apache.tuscany.sca.node.impl.NodeImpl
> configureNode
> INFO: Loading contribution:
> file:/C:/documents%20and%20settings/802518659/workspace/demo V1_1SCA/bin/
> 03-Sep-2009 10:17:48 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: resource/demoSCA.composite
> lookup service
>
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The
> service HelloWorld has not been contributed to the domain
> at org.apache.tuscany.sca.node.impl.NodeImpl.getServiceReferenc
> e(NodeImpl.java:779)
> at org.apache.tuscany.sca.node.impl.NodeImpl.getService(NodeImp
> l.java:746)
> at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.g
> etService(DefaultSCADomain.java:227)
> at demoV1_1Main.main(demoV1_1Main.java:25)
>
>
> :?
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576216 is a reply to message #483842] Thu, 03 September 2009 11:50 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
I hope that worked - i've tried to attached and uploaded - however there no real indication of success.

just incase heres the copies of simplest version (all at top level /src ) (project called demoV1SCA in eclipse)

demoSCA.composite :
<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA" targetNamespace="http://will.org/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
</sca:composite>

client to start the test
demoV1Main.java
import org.apache.tuscany.sca.host.embedded.SCADomain;

public class demoV1Main
{

/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub

//create new Tuscany node


System.out.println("starting new domain\n");

// Locate the service using SCA APIs
SCADomain domain = SCADomain.newInstance("demoSCA.composite");

System.out.println("lookup service\n");
HelloWorld hello = domain.getService(HelloWorld.class, "HelloWorld");


// Calculate
System.out.println("say " + hello.helloWorld());
try
{
System.in.read();
} catch (Exception e)
{
System.exit(0);
}

SCADomain.removeInstance(domain);
}


}


HelloWorld.java - interface spec
import org.osoa.sca.annotations.*;

@Remotable

public interface HelloWorld
{

String helloWorld ();

}


HelloWorldImpl.java - component implementation

import org.osoa.sca.annotations.*;

@Service (HelloWorld.class)
@Scope ("COMPOSITE")

public class HelloWorldImpl implements HelloWorld
{
public String helloWorld ()
{
return "hello William";
}
}


classpath setting in gallileo eclipse project
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/JavaSE-1.6 "/>
<classpathentry kind="lib" path=" C:/eclipse/eclipse/plugins/org.eclipse.stp.sca.osoa.java_2.0 .0.200906170710.jar "/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/tuscany v1 libs"/>
<classpathentry kind="output" path="bin"/>
</classpath>

help that helps show what i have
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576228 is a reply to message #576216] Thu, 03 September 2009 12:38 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Looking at your code, I think that your error comes from the second
attribute of the getService method.

> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");

You're right, the second attribute is the name of the service, but you
must write it as "component name/service name".
As the component has only one service, you can also use only the
component name.

So try:
HelloWorld hello = domain.getService(HelloWorld.class,
"HelloWorldComponent/HelloWorld");

or
HelloWorld hello = domain.getService(HelloWorld.class,
"HelloWorldComponent");


Stephane Drapeau
Obeo


William Woodman a écrit :
> I hope that worked - i've tried to attached and uploaded - however there
> no real indication of success.
>
> just incase heres the copies of simplest version (all at top level /src
> ) (project called demoV1SCA in eclipse)
>
> demoSCA.composite :
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="demoSCA"
> targetNamespace="http://will.org/demoSCA">
> <sca:component name="HelloWorldComponent">
> <sca:implementation.java class="HelloWorldImpl"/>
> <sca:service name="HelloWorld"/>
> </sca:component>
> <sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld"/>
> </sca:composite>
>
> client to start the test demoV1Main.java
> import org.apache.tuscany.sca.host.embedded.SCADomain;
>
> public class demoV1Main {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> //create new Tuscany node
>
> System.out.println("starting new domain\n");
>
> // Locate the service using SCA APIs
> SCADomain domain = SCADomain.newInstance("demoSCA.composite");
>
> System.out.println("lookup service\n");
> HelloWorld hello = domain.getService(HelloWorld.class,
> "HelloWorld");
> // Calculate
> System.out.println("say " + hello.helloWorld());
> try
> {
> System.in.read();
> } catch (Exception e)
> {
> System.exit(0);
> }
>
> SCADomain.removeInstance(domain);
> }
>
>
> }
>
>
> HelloWorld.java - interface spec import org.osoa.sca.annotations.*;
>
> @Remotable
>
> public interface HelloWorld {
>
> String helloWorld ();
>
> }
>
>
> HelloWorldImpl.java - component implementation
> import org.osoa.sca.annotations.*;
>
> @Service (HelloWorld.class)
> @Scope ("COMPOSITE")
>
> public class HelloWorldImpl implements HelloWorld
> {
> public String helloWorld ()
> {
> return "hello William";
> }
> }
>
>
> classpath setting in gallileo eclipse project
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
> <classpathentry kind="src" path="src"/>
> <classpathentry kind="con" path="
> org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte
> rnal.debug.ui.launcher.StandardVMType/JavaSE-1.6 "/>
> <classpathentry kind="lib" path="
> C:/eclipse/eclipse/plugins/org.eclipse.stp.sca.osoa.java_2.0
> .0.200906170710.jar "/>
> <classpathentry kind="con"
> path="org.eclipse.jdt.USER_LIBRARY/tuscany v1 libs"/>
> <classpathentry kind="output" path="bin"/>
> </classpath>
>
> help that helps show what i have
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576253 is a reply to message #483867] Thu, 03 September 2009 14:44 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
Stephanie thanks for that seems a bit weird but it worked this time .

query really on hiding the details. by having to specify
domain.getService(HelloWorld.class, "HelloWorldComponent/HelloWorld")

the client has to understand which component in the composite offers the service - and that should surely be explicit from the service defn on the composite and the promotion/wiring details in the scdl file.

whys does a client have to know the component - when all they are transacting is with the retuerned service (a interface proxy)

seems weird - is there a good reason for this in the SCA specs?

however thanks for getting me started - it was beginningt to drive me not so slowly nuts

Will :p
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576271 is a reply to message #576253] Thu, 03 September 2009 15:51 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
one more question on same area.

tried to now expose the service as a web service - i followed the example in the tuscany basic user guide - however the expected response doesnt come back

modified the scdl spec as follows


<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="demoSCA"
targetNamespace="http://will.org/demoSCA">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:binding.ws uri="http://localhost:8080/HelloWorld"/>
<sca:binding.sca/>
</sca:service>
</sca:composite>

this starts up okay - but when i point the browser a the URI

http://localhost:8080/HelloWorld?/wsdl

i get the following where the targetNamespace is "", and i get an error i cant see off to the right


//browser response cut and paste
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


------------------------------------------------------------ --------------------

The operation completed successfully. Error processing resource 'http://localhost:8080/HelloWorld?wsdl'. Line 2, Position ...

<wsdl:definitions name="HelloWorldService" targetNamespace="" xmlns:tns="" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ...
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576292 is a reply to message #576253] Thu, 03 September 2009 16:19 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
From my point of view, this is not a problem that comes from the SCA
specifications. I think that the getService method provided by Tuscany
has a bug.
getService(HelloWorld.class, "HelloWorld") should work if HelloWorld is
promoted in the composite.
Better to ask directly to the Tuscany community.

Stephane Drapeau
Obeo


William Woodman a écrit :
> Stephanie thanks for that seems a bit weird but it worked this time .
>
> query really on hiding the details. by having to specify
> domain.getService(HelloWorld.class, "HelloWorldComponent/HelloWorld")
>
> the client has to understand which component in the composite offers the
> service - and that should surely be explicit from the service defn on
> the composite and the promotion/wiring details in the scdl file.
> whys does a client have to know the component - when all they are
> transacting is with the retuerned service (a interface proxy)
> seems weird - is there a good reason for this in the SCA specs?
>
> however thanks for getting me started - it was beginningt to drive me
> not so slowly nuts
> Will :p
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576307 is a reply to message #483933] Thu, 03 September 2009 17:28 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
Stepanie

thanks for that i'll check with the tuscany guys -

however have you any idea why my web service doesnt work properly - see previous post?

Will
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576320 is a reply to message #576307] Fri, 04 September 2009 08:40 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Will,

Have you defined your service interface in a Java package?
If not, move the interface in a package named "test" for example.
Tuscany computes namespaces of the generated WSDL from the Java package
names.

I hope this will help you.

Stephane Drapeau
Obeo

William Woodman a écrit :
> Stepanie
>
> thanks for that i'll check with the tuscany guys -
> however have you any idea why my web service doesnt work properly - see
> previous post?
>
> Will
>
>
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576345 is a reply to message #484078] Fri, 04 September 2009 13:01 Go to previous message
William Woodman is currently offline William WoodmanFriend
Messages: 28
Registered: July 2009
Junior Member
stephanie

nearly there i think. I did what you suggested,

i created some directory structure for my interface and the implementation code in a directory will/org/helloWorld below the eclipse src file.

put the exlpicit package statement at the top of the source files - like this for the interface

package will.org.helloWorld;

import org.osoa.sca.annotations.*;

@Remotable

public interface HelloWorld
{

String helloWorld ();

}

i modified the .composite file as follows to put in the fully qualified path (i also set the targetNamespace to be the same for good measure

<sca:composite xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="demoSCA"
targetNamespace="http://will.org.helloWorld">
<sca:component name="HelloWorldComponent">
<sca:implementation.java class="will.org.helloWorld.HelloWorldImpl"/>
<sca:service name="HelloWorld"/>
</sca:component>
<sca:service name="HelloWorld" promote="HelloWorldComponent/HelloWorld">
<sca:binding.ws uri="http://localhost:8080/HelloWorld"/>
<sca:binding.sca/>
</sca:service>
</sca:composite>

I then re ran the test and pointed the browser at the URI and whoopee as you suggested the wsdl is now aautomagically generated.

whats wierd is that the generated targetNamespace in the WSDL is the Reverse of my source path i.e. http://helloWorld.org.will

is that what it should do ? i'd have expected it to come out like in the same order as the path. Is this just another ideosyncratic tuscany v1.5 ' feature' or as expected?

generated WSDL

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="HelloWorldService" targetNamespace="http://helloWorld.org.will/" xmlns:tns="http://helloWorld.org.will/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/">
- <wsdl:types>
- <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://helloWorld.org.will/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="helloWorld">
<xs:complexType />
</xs:element>
- <xs:element name="helloWorldResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
- <wsdl:message name="helloWorld">
<wsdl:part name="helloWorld" element="tns:helloWorld" />
</wsdl:message>
- <wsdl:message name="helloWorldResponse">
<wsdl:part name="helloWorldResponse" element="tns:helloWorldResponse" />
</wsdl:message>
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="helloWorld">
<wsdl:input message="tns:helloWorld" />
<wsdl:output message="tns:helloWorldResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="HelloWorldBinding" type="tns:HelloWorld">
<SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="helloWorld">
<SOAP:operation />
- <wsdl:input>
<SOAP:body use="literal" />
</wsdl:input>
- <wsdl:output>
<SOAP:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="HelloWorldService">
- <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">
<SOAP:address location="http://10.215.2.56:8080/HelloWorld" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

thanks one more time in advance
Re: help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working [message #576360 is a reply to message #576345] Fri, 04 September 2009 14:21 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi William,


William Woodman a écrit :

> whats wierd is that the generated targetNamespace in the WSDL is the
> Reverse of my source path i.e. http://helloWorld.org.will
>
> is that what it should do ? i'd have expected it to come out like in
> the same order as the path. Is this just another ideosyncratic tuscany
> v1.5 ' feature' or as expected?


Yes, it is normal.
When mapping Java to XML (and vice-versa), Java package names are
written in the reversed order to generate the target namespace.


Vincent.


--
Vincent Zurczak
EBM WebSourcing
+33 (0) 4 38 12 91 72
Previous Topic:help:cant get gallileo eclipse STP tuscany v1 or v2 m3 working
Next Topic:A video of SCA Tools
Goto Forum:
  


Current Time: Sat Oct 12 00:27:48 GMT 2024

Powered by FUDForum. Page generated in 0.27697 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top