users@grizzly.java.net

Re: setting up JNDI datasource in embedded Grizzly

From: Philippe Marschall <kustos_at_gmx.net>
Date: Thu, 15 Oct 2009 10:11:40 +0200

Oleksiy Stashok wrote:
> Hi Philippe,
>
> we ship Grizzly without any embedded JNDI provider.
> But you can download one yourself. For example MirrorJNDI [1], which is
> opensource and should be easy to use (just include its jar to the
> application classpath)
>
> Additionally you'll need to explicitly set naming factory like:
> java
> -Djava.naming.factory.initial=com.smardec.jndi.mirror.MirrorInitialCtxFactory
> .....
>
> or in code like:
>
> Hashtable environment = new Hashtable();
> environment.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.smardec.jndi.mirror.MirrorInitialCtxFactory");
>
> Context ctx = new InitialContext(environment);
>
> Hope this will help.

I finally got it working with SimpleJNDI.

Cheers
Philippe