You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by rtselvan <rt...@gmail.com> on 2009/12/04 03:43:24 UTC

InitialContext Close doesn't do anything

I am looking up ejbs from my web app running on a tomcat server and openEJB
running as standalone, when the openEJB server is restarted, the web
application JNDI lookups fails with "Invalid response from server: -1", so I
am trying to close the JNDI context and re-open it but still getting the
same "Invalid response from server: -1" error. It seems that the jndi
context.close doesn't do anything seems due to caching.  Is there a setting
that can be passed to the "RemoteInitialContextFactory" to force close it?

I just tried to use the embedded setting
"openejb.embedded.initialcontext.close=destroy" but doesn't appear to be the
correct property for the purpose.

Thanks
/selvan

-- 
View this message in context: http://old.nabble.com/InitialContext-Close-doesn%27t-do-anything-tp26635749p26635749.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: InitialContext Close doesn't do anything

Posted by rtselvan <rt...@gmail.com>.
Later I tested with a web server running inside eclipse [debug mode]  and it
works as expected but it is not working from a JUnit tests. It could be a
classpath or similar issue for the JUnit Test Case. 

Thanks the suggestion though and it is good to know that there is an another
option for it.

Thanks
/selvan


David Blevins wrote:
> 
> 
> On Dec 4, 2009, at 12:04 PM, Stephen Connolly wrote:
> 
>> That property will shutdown the local openejb instance that you have  
>> created
>> with the InitialContext... I suspect that is not what you are  
>> after.  The
>> property is most useful when running unit tests where you need to  
>> restart
>> the container to check with some other initial conditions
> 
> Exactly.
> 
>> 2009/12/4 rtselvan <rt...@gmail.com>
>>
>>>
>>> I am looking up ejbs from my web app running on a tomcat server and  
>>> openEJB
>>> running as standalone, when the openEJB server is restarted, the web
>>> application JNDI lookups fails with "Invalid response from server:  
>>> -1", so
>>> I
>>> am trying to close the JNDI context and re-open it but still  
>>> getting the
>>> same "Invalid response from server: -1" error. It seems that the jndi
>>> context.close doesn't do anything seems due to caching.  Is there a  
>>> setting
>>> that can be passed to the "RemoteInitialContextFactory" to force  
>>> close it?
> 
> What OpenEJB version are you using?  We had an issue with this I  
> thought we had fixed.
> 
> An alternate approach would be to use the http protocol instead.  Try  
> using this as your initial context url:
> 
>    http://127.0.0.1:8080/openejb/ejb
> 
> Adjust the host and port to be where you have Tomcat running.
> 
> Hope that helps!
> 
> -David
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/InitialContext-Close-doesn%27t-do-anything-tp26635749p26755374.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: InitialContext Close doesn't do anything

Posted by David Blevins <da...@visi.com>.
On Dec 4, 2009, at 12:04 PM, Stephen Connolly wrote:

> That property will shutdown the local openejb instance that you have  
> created
> with the InitialContext... I suspect that is not what you are  
> after.  The
> property is most useful when running unit tests where you need to  
> restart
> the container to check with some other initial conditions

Exactly.

> 2009/12/4 rtselvan <rt...@gmail.com>
>
>>
>> I am looking up ejbs from my web app running on a tomcat server and  
>> openEJB
>> running as standalone, when the openEJB server is restarted, the web
>> application JNDI lookups fails with "Invalid response from server:  
>> -1", so
>> I
>> am trying to close the JNDI context and re-open it but still  
>> getting the
>> same "Invalid response from server: -1" error. It seems that the jndi
>> context.close doesn't do anything seems due to caching.  Is there a  
>> setting
>> that can be passed to the "RemoteInitialContextFactory" to force  
>> close it?

What OpenEJB version are you using?  We had an issue with this I  
thought we had fixed.

An alternate approach would be to use the http protocol instead.  Try  
using this as your initial context url:

   http://127.0.0.1:8080/openejb/ejb

Adjust the host and port to be where you have Tomcat running.

Hope that helps!

-David


Re: InitialContext Close doesn't do anything

Posted by Stephen Connolly <st...@gmail.com>.
That property will shutdown the local openejb instance that you have created
with the InitialContext... I suspect that is not what you are after.  The
property is most useful when running unit tests where you need to restart
the container to check with some other initial conditions

-Stephe

2009/12/4 rtselvan <rt...@gmail.com>

>
> I am looking up ejbs from my web app running on a tomcat server and openEJB
> running as standalone, when the openEJB server is restarted, the web
> application JNDI lookups fails with "Invalid response from server: -1", so
> I
> am trying to close the JNDI context and re-open it but still getting the
> same "Invalid response from server: -1" error. It seems that the jndi
> context.close doesn't do anything seems due to caching.  Is there a setting
> that can be passed to the "RemoteInitialContextFactory" to force close it?
>
> I just tried to use the embedded setting
> "openejb.embedded.initialcontext.close=destroy" but doesn't appear to be
> the
> correct property for the purpose.
>
> Thanks
> /selvan
>
> --
> View this message in context:
> http://old.nabble.com/InitialContext-Close-doesn%27t-do-anything-tp26635749p26635749.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>