Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] JNDI and OSGI

Hi Ernesto,

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
difficult.

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
architecture :-)

Regards,
Neil


> Hi,
>
> 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
> ask).
>
> 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
> exception) .
>
> Best regards,
>
> Ernesto
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>




Back to the top