You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Rashmi Hunt <ra...@gmail.com> on 2006/07/10 18:35:46 UTC

NullPointerException while running EagerInit sample in sandbox

Hello,

I have latest sandbox code and I am trying to run earinit sample in Eclipse.
I am getting  NullPointerException while locating the service because
compositeContext is null

Snippet from EagerInitClient.java

*       CompositeContext compositeContext =
CurrentCompositeContext.getContext();*

*        // Locate the Eager init service
        EagerInitService eagerInitService =
                compositeContext.locateService(EagerInitService.class,
"EagerInitComponent");*

Please let me know how to run this sample.

Help is apprecited.

Regards

Rashmi

Re: NullPointerException while running EagerInit sample in sandbox

Posted by Jeremy Boynes <jb...@apache.org>.
I have added a SCATestCase base class to the "test" module that boots  
an SCA client runtime in the same way the launcher does. To keep  
things simple it does not do any classloader isolation magic so it  
should be fairly easy to step through application code or the runtime  
itself.

I added an example testcase to the local.wire sample that shows it  
being used.
--
Jeremy


On Jul 10, 2006, at 3:45 PM, Jim Marino wrote:

> I think we'll need something similar for application code (although  
> hopefully simpler). It would also be good perhaps to create some  
> time of runner like there is for JUnit with an "embedded launcher"  
> too.
>
> Jim
>
>
> On Jul 10, 2006, at 1:01 PM, Jeremy Boynes wrote:
>
>> On Jul 10, 2006, at 9:35 AM, Rashmi Hunt wrote:
>>
>>> Hello,
>>>
>>> I have latest sandbox code and I am trying to run earinit sample  
>>> in Eclipse.
>>> I am getting  NullPointerException while locating the service  
>>> because
>>> compositeContext is null
>>>
>>> Snippet from EagerInitClient.java
>>>
>>> *       CompositeContext compositeContext =
>>> CurrentCompositeContext.getContext();*
>>>
>>> *        // Locate the Eager init service
>>>        EagerInitService eagerInitService =
>>>                compositeContext.locateService 
>>> (EagerInitService.class,
>>> "EagerInitComponent");*
>>>
>>> Please let me know how to run this sample.
>>
>> Are you running this through the launcher?
>> http://article.gmane.org/ 
>> gmane.comp.apache.webservices.tuscany.devel/4608
>>
>> I was able to run this in idea in two ways:
>> 1) using the remote debugger
>> 2) using the application debugger on the launcher specifying the  
>> correct command line options
>>     I also needed to set -Dtuscany.bootDir to make sure it picked  
>> up the boot jars from the right place
>>
>> YMMV may vary depending on what Eclipse does to the classpath but  
>> if you do have issues please ping the list.
>>
>> Do you think we need something like the TuscanyRuntime from M1  
>> that would allow you to bootstrap the runtime from inside the  
>> application code?
>>
>> --
>> Jeremy


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: NullPointerException while running EagerInit sample in sandbox

Posted by Jim Marino <jm...@myromatours.com>.
I think we'll need something similar for application code (although  
hopefully simpler). It would also be good perhaps to create some time  
of runner like there is for JUnit with an "embedded launcher" too.

Jim


On Jul 10, 2006, at 1:01 PM, Jeremy Boynes wrote:

> On Jul 10, 2006, at 9:35 AM, Rashmi Hunt wrote:
>
>> Hello,
>>
>> I have latest sandbox code and I am trying to run earinit sample  
>> in Eclipse.
>> I am getting  NullPointerException while locating the service because
>> compositeContext is null
>>
>> Snippet from EagerInitClient.java
>>
>> *       CompositeContext compositeContext =
>> CurrentCompositeContext.getContext();*
>>
>> *        // Locate the Eager init service
>>        EagerInitService eagerInitService =
>>                compositeContext.locateService(EagerInitService.class,
>> "EagerInitComponent");*
>>
>> Please let me know how to run this sample.
>
> Are you running this through the launcher?
> http://article.gmane.org/ 
> gmane.comp.apache.webservices.tuscany.devel/4608
>
> I was able to run this in idea in two ways:
> 1) using the remote debugger
> 2) using the application debugger on the launcher specifying the  
> correct command line options
>     I also needed to set -Dtuscany.bootDir to make sure it picked  
> up the boot jars from the right place
>
> YMMV may vary depending on what Eclipse does to the classpath but  
> if you do have issues please ping the list.
>
> Do you think we need something like the TuscanyRuntime from M1 that  
> would allow you to bootstrap the runtime from inside the  
> application code?
>
> --
> Jeremy
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: NullPointerException while running EagerInit sample in sandbox

Posted by Jeremy Boynes <jb...@apache.org>.
On Jul 10, 2006, at 9:35 AM, Rashmi Hunt wrote:

> Hello,
>
> I have latest sandbox code and I am trying to run earinit sample in  
> Eclipse.
> I am getting  NullPointerException while locating the service because
> compositeContext is null
>
> Snippet from EagerInitClient.java
>
> *       CompositeContext compositeContext =
> CurrentCompositeContext.getContext();*
>
> *        // Locate the Eager init service
>        EagerInitService eagerInitService =
>                compositeContext.locateService(EagerInitService.class,
> "EagerInitComponent");*
>
> Please let me know how to run this sample.

Are you running this through the launcher?
http://article.gmane.org/gmane.comp.apache.webservices.tuscany.devel/ 
4608

I was able to run this in idea in two ways:
1) using the remote debugger
2) using the application debugger on the launcher specifying the  
correct command line options
     I also needed to set -Dtuscany.bootDir to make sure it picked up  
the boot jars from the right place

YMMV may vary depending on what Eclipse does to the classpath but if  
you do have issues please ping the list.

Do you think we need something like the TuscanyRuntime from M1 that  
would allow you to bootstrap the runtime from inside the application  
code?

--
Jeremy




---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org