tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Karalus <>
Subject Re: "Local server is not initialized"
Date Wed, 10 Sep 2008 08:38:22 GMT

Jean Louis,

thank you for your quick reply. 
I start openejb in the way you described, and the startup is fine. 
I am also able to test some ejbs.
However, if somewhere in our code, a new InitialContext is initialized, I
get the exception.

so basically I have following configuration:

class Beanfactory{
 static void initContainer() {
   Properties properties = new Properties();
   InitialContext ctx = new InitialContext(properties);

I want to test code that performs itself a "InitialContext ctx = new
InitialContext()". This works well with jboss.embedded, but fails with
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


Jean-Louis MONTEIRO wrote:
> Andreas,
> Seems like you are still using JBoss InitialContext implementation. 
> Did you set your system properties to use OpenEJB InitialContextFactory ?
> Properties properties = new Properties();
> properties.put(Context.INITIAL_CONTEXT_FACTORY, 
>         "org.openejb.client.LocalInitialContextFactory");
> InitialContext ctx = new InitialContext(properties);
> Regards,
> Jean-Louis
> Andreas Karalus wrote:
>> first of all, I would like to thank all the people in forum for the quick
>> responses. openejb looks like solid piece of software.
>> however, i'm still running into problems while trying to migrate our
>> jboss embedded tests to openejb. 
>> booting of openejb works fine, however, we have some places in our code
>> where we do a new InitialContext(). whenever this code is reached while
>> openejb is running, I get a javax.naming.NamingException
>> INFO - Deployed
>> Application(path=D:\projekte\HEAD\ed02\env\testframework\target\classes)
>> javax.naming.NamingException: Local server is not initialized
>> 	at
>> org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(
>> 	at
>> javax.naming.spi.NamingManager.getInitialContext(
>> 	at
>> javax.naming.InitialContext.getDefaultInitCtx(
>> 	at javax.naming.InitialContext.init(
>> 	at javax.naming.InitialContext.<init>(
>> ...	
>> any ideas welcome,
>> regards,
>> andreas

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message