geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toby cabot <>
Subject Re: Geronimo JNDI properties
Date Fri, 27 Aug 2004 02:55:31 GMT
On Wed, Aug 25, 2004 at 11:13:45AM +0200, Jacek Laskowski wrote:
> Just saw the thread, and I'm concerned with the system properties and 
> the JNDI factories. Would you send me an example that proves it?

Hi Jacek,

Thanks for the help.  Here's the story:

If I set up a simple EJB (like the ones used in the OpenEJB remote
tests) and call it remotely it works fine if I specify the 4
parameters needed in code

        Properties p = new Properties();
        p.put("java.naming.factory.initial", "org.openejb.client.RemoteInitialContextFactory");
        p.put("java.naming.provider.url", "");
        p.put("", "myuser");
        p.put("", "mypass");

And it also works if I put the first two on the command line

        Properties p = new Properties();
        p.put("", "myuser");
        p.put("", "mypass");

$ java -Djava.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory -Djava.naming.provider.url=

but if I try to put the on the command

        Properties p = new Properties();
        p.put("", "mypass");

$ java -Djava.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory -Djava.naming.provider.url= etc...

then I get

javax.naming.ConfigurationException: Context property cannot be null:
        at org.openejb.client.JNDIContext.getInitialContext(
        at javax.naming.spi.NamingManager.getInitialContext(
        at javax.naming.InitialContext.getDefaultInitCtx(
        at javax.naming.InitialContext.init(
        at javax.naming.InitialContext.<init>(
        at g6o.ServerUnitTest.newOpenEJBInitialContext(
        at g6o.ServerUnitTest.findStatelessSessionBean(
        at g6o.ServerUnitTest.testPing(

I thought that perhaps junit wasn't passing the properties through,
but since the first two get propagated I think that's not likely to be
the problem.

If you'd like me to send you code please let me know.


View raw message