users@glassfish.java.net

JNDI lookup of a specific SLSB / multiple Instances of a single App

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Jun 2009 09:41:02 PDT

hi!

I have a rather specific problem:

I need to run multiple instances of the same application in a single appserver. These instances differ in software version (sometimes) and the data-sources they use (always). Think of it as running on a production and a development database, although it's not that simple.

I now have to be able to retrieve a specific SLSB both from whithin the application as well as from the "outside" (a stand-alone Java client). The former could probably be achieved using ejb-injection, but a viable solution for the latter eludes me.

I currently use InitialContext.lookup("ejb/SLSB"), but how can I be sure which SLSB I get?

I know that in JBoss I can use InitialContext.lookup("appname/SLSB/remote"), but unfortunately Glassfish doesn't seem to support this.

Although I can change Sourcecode for each application (allowing me to for example change the @Stateless(name= value, or maybe even to assign unique package/classnames), it would of course be much smoother if this could be done by just changing one (or many) deployment-descriptor XML files like application.xml or ejb-jar.xml or some such.

I did try google- and the forum search on this, but it's rather difficult to find good keywords, so if this is a simple RTFM please point me to the relevant resources...

Thanks in advance fo your time
[Message sent by forum member 'nsn' (nsn)]

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