tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Karalus <andreas.kara...@googlemail.com>
Subject Re: "Local server is not initialized"
Date Wed, 10 Sep 2008 14:42:45 GMT

david, 

thank you very much!
I followed your hint and changed the jndi.properties for tests like you
suggested and everything works fine.
you are doing a great job here, thank you!

andreas



David Blevins wrote:
> 
> 
> On Sep 10, 2008, at 1:38 AM, Andreas Karalus wrote:
> 
>> I want to test code that performs itself a "InitialContext ctx = new
>> InitialContext()". This works well with jboss.embedded, but fails with
>> openejb.
>> For jboss.embedded we use a jndi.properties as configuration. so if  
>> the file
>> is present in classpath, new IntialContext() works fine. I wonder if  
>> there
>> is a similar configuration in openejb?
> [...]
>>
>> p.s. here is the data in jndi.properties
>>
>> java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
>> java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
> 
> Right, it's the java.naming.factory.url.pkgs line that's causing the  
> problem.  A snippet from the InitialContext javadoc:
> 
>     JNDI determines each property's value by merging the values from
>     the following two sources, in order:
> 
>     1. The first occurrence of the property from the constructor's
>        environment parameter and (for appropriate properties) the
>        applet parameters and system properties.
> 
>     2. The application resource files (jndi.properties).
> 
> 
> The vm is picking JBoss's org.jboss.naming and org.jnp.interfaces  
> packages for all "java:" lookups instead of ours because the values of  
> the jndi.properties file are getting merged with your InitialContext  
> properties.
> 
> You could either delete your jndi.properties file completely or you  
> could update it as follows:
> 
>     
> java 
> .naming 
> .factory.initial=org.apache.openejb.client.LocalInitialContextFactory
>    java.naming.factory.url.pkgs=org.apache.openejb.core.ivm.naming
> 
> 
> Just make sure that you don't use these settings in an actual remote  
> client running in a different VM than the server.  There you'd use  
> these settings:
> 
>     
> java 
> .naming 
> .factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
>    java.naming.factory.url.pkgs=org.apache.openejb.client
> 
> 
> -David
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%22Local-server-is-not-initialized%22-tp19396008p19414605.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message