I need to do a jndi lookup in a class which I use both in Glassfish and outside a container.
In Glassfish the following doesn't seem to work:
InitialContext ctx = new InitialContext();
ctx.lookup("java:comp/env/something");
But this works:
ctx.lookup("something");
I don't want to use to solutions to do this. What am I doing wrong? In Glassfish I added the resource through the admin console.
Thanks!
[Message sent by forum member 'woel' (woel)]
http://forums.java.net/jive/thread.jspa?messageID=241640