users@glassfish.java.net

Re: JMS and glassfish ...

From: <glassfish_at_javadesktop.org>
Date: Thu, 19 Aug 2010 02:46:44 PDT

Dear Whatsamatteru,

> I'm an embedded guy trying to do JEE stuff.

Then you might like to read the JavaEE tutorial
http://download.oracle.com/javaee/5/tutorial/doc/index.html

> I want to use JNDI service for context and lookup whats available

If you want to write a client that makes use of Glassfish resources such as connection factories, but doesn't actually run in the Glassfish server itself, then the standard way of doing this is to run your client in the Glassfish Application Client Container.

This is documented in the Glassfish 2.1.1 Developers' Guide here:
http://docs.sun.com/app/docs/doc/821-0181/beakt?l=en&a=view

Then you can simply instantiate an InitialContext without specifying any properties:

jndiContext = new InitialContext()

and it will know where to look.

Nigel
[Message sent by forum member 'nigeldeakin']

http://forums.java.net/jive/thread.jspa?messageID=480546