SCADomain.newInstance stops after loading contribution [message #577867] |
Thu, 02 September 2010 13:17  |
Eclipse User |
|
|
|
Hello,
I'm trying to deploy a web service with TUSCANY and SCA. I got it once, but now I'm trying again and it won't work.
Composite file as follows:
Quote:
> <?xml version="1.0" encoding="UTF-8"?>
> <sca:composite xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="TMBrowser" targetNamespace="http://eclipse.org/tmbrowser.deploy/src/TMBrowser">
> <sca:component name="TMBrowserComponent">
> <sca:implementation.java class="tmbrowser.impl.TMBrowserServiceImpl"/>
> <sca:service name="TMBrowserService">
> <sca:interface.java interface="tmbrowser.api.TMBrowserService"/>
> <sca:binding.ws uri="http://localhost:8080/TMBrowser"/>
> </sca:service>
> </sca:component>
> </sca:composite>
Running it as Java application prints:
Quote:
> 02.09.2010 18:59:43 org.apache.tuscany.sca.node.impl.NodeImpl <init>
> INFO: Creating node: TMBrowser.composite
> 02.09.2010 18:59:45 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
> INFO: Loading contribution: file:/D:/Projekte/TM/dev/source/projects/tmbrowser.deploy/bi n/
> Exception in thread "main" java.lang.NullPointerException
> at tmbrowser.deploy.TMBrowserDeployment.main(TMBrowserDeploymen t.java:29)
Line 29 is the line with "scaDomain.close();", whole file is copied from SCA tutorials.
Quote:
> try {
> scaDomain = SCADomain.newInstance( "TMBrowser.composite" );
> char c;
> while(( c = (char) System.in.read()) != 'q' ) {
> System.out.println( c );
> }
> } catch (IOException e) {
> e.printStackTrace();
> } finally {
> scaDomain.close();
> }
That's it. And I really don't know where to look for any log files.
JRE1.6 & TUSCANY1.6 user library are in the build path.
I'd be glad if anyone could help. Why wouldn't there be any error message? SCA normally seems not to be so silent...
Thanks in advance,
Frieder.
|
|
|
|
|
Re: SCADomain.newInstance stops after loading contribution [message #577972 is a reply to message #577915] |
Wed, 15 September 2010 05:48  |
Eclipse User |
|
|
|
Hi,
Le 13/09/2010 18:16, Frieder Jacobi a écrit :
> Thank you for your answer.
> This surely would solve the problem of the NPE... but this has not been
> the point, since it is totally unclear why SCADomain.newInstance returns
> null.
>
> However, I reset the whole project and it worked. I yet don't know what
> has been the problem...
For the NPE, just initialize the domain to null and test it before
closing it (in the finally block).
Why domain.newInstance would return null?
I can't remember what represents the parameter of newInstance.
Is it the composite name, or the relative location of the composite in
the class path?
In this last case,
> SCADomain.newInstance( "TMBrowser.composite" )
would mean that the composite is right under your "bin" directory.
Is your project built automatically? See the manu "Project > Build
automatically...".
Regards,
Vincent.
|
|
|
Powered by
FUDForum. Page generated in 0.03796 seconds