Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Service Component Architecture (SCA) Tools » SCADomain.newInstance stops after loading contribution(return value is null, no further error message provided)
SCADomain.newInstance stops after loading contribution [message #556817] Thu, 02 September 2010 17:17 Go to next message
Frieder Jacobi is currently offline Frieder JacobiFriend
Messages: 5
Registered: February 2010
Junior Member
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 #558597 is a reply to message #556817] Mon, 13 September 2010 15:51 Go to previous messageGo to next message
nouramin  is currently offline nouramin Friend
Messages: 13
Registered: August 2010
Junior Member
Hi
try to put this instruction "scaDomain.close()" inside the block try catch .
Re: SCADomain.newInstance stops after loading contribution [message #558605 is a reply to message #556817] Mon, 13 September 2010 16:16 Go to previous messageGo to next message
Frieder Jacobi is currently offline Frieder JacobiFriend
Messages: 5
Registered: February 2010
Junior Member
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...
Re: SCADomain.newInstance stops after loading contribution [message #559004 is a reply to message #558605] Wed, 15 September 2010 09:48 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 140
Registered: July 2009
Senior Member
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.
Previous Topic:consuming a web service
Next Topic:SCADomain.newInstance stops after loading contribution
Goto Forum:
  


Current Time: Sun Dec 21 21:05:13 GMT 2014

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

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