On Tue, Sep 1, 2009 at 1:41 PM, Renana Heller<[email protected]> wrote:
> hello,
> I have a java program with a WS service interface and I want to write a web
> application which connects to it.
> I created a jsp file which creates reference to a Client Component (using
> implementation.web), and I have in the ClientImpl class a reference to an
> interface implemented by WS (binding.ws)
> but when I execute the jsp file, when the client tries to call a method from
> the interface I get null pointer exception.
> The composite I have is:
>
>     <component name="foo">
>
>         <implementation.web web-uri=""/>
>
>         <reference name="service" target="MyClientComponent"/>
>
>     </component>
>
>     <component name="MyClientComponent">
>
>         <implementation.java class="Client.MyClientImpl" />
>
>         <reference name="myService">
>
>             <interface.java interface="Client.MyService"
>
>                     callbackInterface="Client.MyServiceCallback" />
>
>             <binding.ws uri="http://localhost:8082/BigMediMash"; />
>
>             <callback>
>
>                 <binding.ws uri="http://localhost:8083/MashCallback"/>
>
>             </callback>
>
>         </reference>
>
>     </component>
>
>
>
> I get null when I call myService.method() from MyClientImpl.
>
>
>
> I tried seperating the composite to two composites.
> first one for the jsp and the Client Class (without the reference), and then
> call another composite using the following code:
>
> Node node = NodeFactory.newInstance().createNode("client.composite",
> MyClientImpl.class.getClassLoader());
> node.start();
> MyClient myClient = ((Client)node).getService(MyClient.class,
> "MyClientComponent");
>
> But I get the same error (null pointerexception)
> How Can I inject MyService interface to the code?
> Thanks,
> Renana.
>

I wonder if its some dependencies missing, could you show a the
console log of the startup to see if there are any warning messages?
How are you running the composite - from a webapp or using the
standalone runtime from the Tuscany binary distribution?

  ...ant

Reply via email to