[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] JNDI and OSGI
- From: "Simon Kaegi" <simon.kaegi@xxxxxxxxx>
- Date: Mon, 29 Jan 2007 12:51:44 -0500
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=H53vfOSvcIgxDm2PCEmBBmBeUPAKsSUeCRHTGicP5E34jDDEB48URp5nj4MKaQVFUWOojs9Fq6GN30LmglD4qWEoQLiKHbNFipdqe8EIf4Ptd58iXwqtRN9kPnYMEQCfvyf1zQd34bwy9kCxUoxS+fVIgK7p2aV9A/jcp79iY2Y=
To add to Neil's comment....
The newsgroup would probably be better for this.
JNDI interaction is tough as (at least in the implementations I've looked
at) it tends to depend on specific instances of the thread context class
I'm guessing JBoss is going to be pretty standard in this regard in which
case it's NamingManager might be looking for your webapps class loader.
This is not pretty and I'd be interested in seeing if we can come up with a
general solution to the problem however I can suggest an approach if you're
desperate. Before creating your InitialContext and whenever making lookup
calls set (and then reset) your thread context class loader to the webapps.
You can get the webapp classloader in a variety of ways however the easiest
might be to import org.eclipse.equinox.servletbridge and then do something
----- Original Message -----
From: "Neil Bartlett" <njbartlett@xxxxxxxxx>
To: "Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>
Sent: Monday, January 29, 2007 12:33 PM
Subject: Re: [equinox-dev] JNDI and OSGI
I'm not 100% this is suitable for this list, but then I don't know where
else it should be asked so I'll have a go at answering anyway.
It sounds like your JNDI InitialContext is trying to make a remote
connection to an external JNDI server via the network. Presumably since
your code is running inside JBoss, you actually want to use the JBoss
internal JNDI context. Ensure that there are no jndi.properties files
anywhere on the classpath. Some vendors "helpfully" include a
jndi.properties file in the JARs that they ship, just to make life
Also ensure that you setup the JNDI data source as an environment
reference in the web.xml, and in the jboss_web.xml, and then use the
"java:comp/env" prefix for your JNDI lookup...
Alternatively, you could stop jumping through all these ridiculous hoops
just to use a legacy technology like JNDI, and try going with an all-OSGi
I have a question regarding using JNDI (e.g. to look-up DataSources)
and running equinox via a the servletbridge. I hope this is the right
place to post it (if not my apologies, and please tell me where should I
My question is simple. Is it possible to directly access JNDI resource
from a bundle. I'm trying to access a DataSource defined in JBoss and I
get a javax.naming.CommunicationException (with a nested timeout
equinox-dev mailing list
equinox-dev mailing list