Hi,

   We are trying to deploy an OSGi aplication in JBoss AS 7 which is working perfectly in an Equinox installation. We would like to leverage the capabilities of jboss-modules and jboss-osgi integration but it is indeed this kind of interaction what makes our aplication undeployable in JBoss AS 7.

   Our application uses JPA with hibernate for database persistence and has both, hibernate ( and hibernate-annotations ) and javax.persistence present as OSGi bundles. Our application expects javax.persistence API classes to be loaded by the OSGi container classloader to work properly, but what we think is happenning in JBoss AS 7 is that javax.persistence is being loaded by a jboss-module's ModuleClassLoader that it's outside of the OSGi container classloader. We could confirm this point debugging the javax.persistence interactions and found that its thread's classloader is the same classloader as the Jboss Modular Service Container  ( org.jboss.msc ) ...   Does this makes sense?

   Is there any way of avoiding sharing at least certain jboss-modules' modules with jboss-osgi running applications?   How can one priorize OSGi bundles over jboss-modules in a given installation?


Greets,

Alberto R. Galdo
argaldo@gmail.com