Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] OSGi class loading issue

Hi guys

I'm pretty new on this discussion list, so i'll say hello to you all.

I have a problem with some OSGi bundles I developed and being used from a RCP application.
The short description follows:

The RCP application uses an API (simple Java interfaces and some abstract classes that uses javax.jms package) declared into a bundle and exported by it (this bundle exports both javax.jms package from a jar file and my API package, my.package.itf). The API is available to the RCP application by a require-bundle directive to this API bundle.

There are also 3 other OSGi bundles, each of them importing these two packages by a require-bundle directive to the API bundle. Each of these 3 packages represents a different version of JMS messaging (Jboss msg, Jboss mq, ActiveMQ), and every one of them has inside them the required JBoss libraries for making a connection to a messaging server. The connection & communication is done by implementing the interfaces the API bundle exports. Also, each of these 3 bundles register different implementations of the same interface, using different properties.

I get those

Now, the problem is that when i try to connect from my RCP application to different messaging servers: it seems that the bundles share at a certain point a single class path, because if i try to connect first to a JBoss Msg, it succeeds, but after that if i try to connect to a ActiveMQ or Jboss MQ server (multiple live connections must be handled), I retrieve the correct implementation by a ServiceTracker but it seems to use the class path of the first messaging bundle, and from here it derives to "ClassNotFoundException", which are normal when you would use some libraries from a certain type server to connect to another type of server.

Anyone can help me with this?

Thanks & regards,
Daniel

Back to the top