tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: "Local server is not initialized"
Date Wed, 10 Sep 2008 09:52:38 GMT

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 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
> 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 (

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 file are getting merged with your InitialContext  

You could either delete your file completely or you  
could update it as follows:


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:



View raw message