Quantcast

Karaf ClassNotFoundException JNDI lib

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Karaf ClassNotFoundException JNDI lib

eugene
Hello,

So here is my question that I have. I am using some JNDI lib : org.apache.qpid.jndi.PropertiesFileInitialContextFactory

and I am trying to connect to the RED HAT mrg. One bundle A exports this lib, and another bundle B imports this class (org.apache.qpid.jndi.PropertiesFileInitialContextFactory). Because this is JNDI it needs a correctly set class loader to work, otherwise I will get a ClassNotFoundException, even if bundle A is exporting this class.

Until now we were using Virgo, and had two solutions for this issue:

1. Use the <Import-Bundle> inside maven bundle plugin, specific for virgo.
2. Use Thread.currentThread().setContextClassLoader(PropertiesFileInitialContextFactory.class.getClassLoader());

whenever I needed to access the JNDI class.

Unfortunately neither of these seem to work in Karaf.

Can someone advise me on this?

Thank You,
Eugene.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Karaf ClassNotFoundException JNDI lib

Tcharl
What about Aries JNDI?
Loading...