Hi, well after looking at the headers of the openjpa and geronimo-jms bundle it's quite clear why that happened. The openjpa bundle does have a optional dependency to 1.1.0 of JTA while the geronimo-jms bundle is using any JTA package 1.1.0 or higher. Therefore the resolver will bind the highest available package of the jta package to the JMS. So basically it's an issue in the dependency chain of the two projects. OTH for JMS it might be ok to have a 1.2.0 dependency. So what can we do about that? one idea would be to patch the openjpa bundle to actually have a required dependency for jta 1.1.0, but this most likely will clash on the resolver level already as you'll end up with two dependency chains. my second Idea to actually use regions for this to have some bigger isolation on this didn't work out. Actually it's some other issues one runs into. Maybe regions is broken, need to investigate that.
regards, Achim p.s. to have regions you would do the following: feature:install -g root/jpa jpa openjpa for the jpa bundle and feature:install -g root/jms jms transaction-api for the jms bundles it seems to work in the beginning, but now you're missing some other dependencies which are actually already installed with the jpa feature. 2015-10-01 23:57 GMT+02:00 John Ellinwood <[email protected]>: > *PROBLEM:* > > The openjpa feature doesn't work on Karaf 4.0.1 when the JMS feature is > also > installed. Its related to the javax.transaction package. OpenJPA can't > wire to the JTA 1.1.0 bundle, but ONLY when the JTA 1.2.0 bundle is also > installed, as required by the JMS feature. I get this exception: > > ERROR: Bundle org.apache.openjpa [75] Error starting > mvn:org.apache.openjpa/openjpa/2.4.0 (org.osgi.framework.BundleException: > Activator start error in bundle org.apache.openjpa [75].) > java.lang.NoClassDefFoundError: javax/transaction/SystemException > at > > org.apache.openjpa.persistence.osgi.PersistenceActivator.start(PersistenceActivator.java:61) > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2220) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2138) > at > org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1365) > at > > org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.SystemException not found by org.apache.openjpa [75] > at > > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558) > at > > org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) > at > > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 7 more > > *ENVIRONMENT:* > Karaf 4.0.1 > java version "1.8.0_60" > Java(TM) SE Runtime Environment (build 1.8.0_60-b27) > Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) > Linux 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 > x86_64 x86_64 GNU/Linux > > *TEST CASE:* > > A simple test with a clean karaf 4.0.1: > > $> $KARAF_HOME/bin/karaf > > > exports | grep 'javax.transaction ' > javax.transaction | 0.0.0 | 0 | > org.apache.felix.framework > > > feature:install jpa > > exports | grep 'javax.transaction ' > javax.transaction | 0.0.0 | 0 | > org.apache.felix.framework > javax.transaction | 1.2.0 | 55 | > javax.transaction-api > > > feature:install openjpa > > exports | grep 'javax.transaction ' > javax.transaction | 0.0.0 | 0 | > org.apache.felix.framework > javax.transaction | 1.1.0 | 72 | > org.apache.geronimo.specs.geronimo-jta_1.1_spec > > > la -s | grep -i openjpa > 75 | Active | 29 | 2.4.0 | org.apache.openjpa > > > feature:install jms > > exports | grep 'javax.transaction ' > javax.transaction | 0.0.0 | 0 | > org.apache.felix.framework > javax.transaction | 1.1.0 | 72 | > org.apache.geronimo.specs.geronimo-jta_1.1_spec > javax.transaction | 1.2.0 | 84 | > javax.transaction-api > > > la -s | grep -i openjpa > 75 | Active | 29 | 2.4.0 | org.apache.openjpa > > > tree-show 75 > Bundle org.apache.openjpa [75] is currently ACTIVE > org.apache.openjpa [75] > +- org.apache.commons.pool [69] > +- org.apache.servicemix.bundles.commons-dbcp [77] > | +- org.apache.commons.pool [69] > | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [72] > +- org.apache.xbean.asm5-shaded [79] > +- org.apache.commons.lang [68] > +- org.apache.commons.collections [67] > +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [70] > | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [72] > +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.karaf.services.eventadmin [6] > | +- org.apache.felix.metatype [5] > | +- org.apache.felix.configadmin [3] > +- org.apache.servicemix.bundles.ant [76] > +- org.apache.geronimo.specs.geronimo-jpa_2.0_spec [71] > +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [72] > +- org.apache.geronimo.specs.geronimo-servlet_2.5_spec [73] > +- org.apache.servicemix.bundles.serp [78] > > > ^D #restart karaf here > > $> $KARAF_HOME/bin/karaf > ERROR: Bundle org.apache.openjpa [75] Error starting > mvn:org.apache.openjpa/openjpa/2.4.0 (org.osgi.framework.BundleException: > Activator start error in bundle org.apache.openjpa [75].) > java.lang.NoClassDefFoundError: javax/transaction/SystemException > at > > org.apache.openjpa.persistence.osgi.PersistenceActivator.start(PersistenceActivator.java:61) > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2220) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2138) > at > org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1365) > at > > org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.SystemException not found by org.apache.openjpa [75] > at > > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558) > at > > org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) > at > > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 7 more > > > la -s | grep -i openjpa > 75 | Resolved | 29 | 2.4.0 | org.apache.openjpa > > > tree-show 75 > Bundle org.apache.openjpa [75] is currently RESOLVED > org.apache.openjpa [75] > +- org.apache.geronimo.specs.geronimo-jpa_2.0_spec [71] > +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.karaf.services.eventadmin [6] > | +- org.apache.felix.metatype [5] > | +- org.apache.felix.configadmin [3] > +- org.apache.geronimo.specs.geronimo-servlet_2.5_spec [73] > +- org.apache.servicemix.bundles.commons-dbcp [77] > | +- javax.transaction-api [84] > | | +- javax.enterprise.cdi-api [82] > | | | +- javax.el-api [81] > | | | +- org.apache.servicemix.bundles.javax-inject [88] > | | | +- javax.interceptor-api [83] > | | +- javax.interceptor-api [83] > | +- org.apache.commons.pool [69] > +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [70] > | +- javax.transaction-api [84] > +- org.apache.commons.pool [69] > +- org.apache.servicemix.bundles.ant [76] > +- org.apache.servicemix.bundles.serp [78] > +- org.apache.commons.lang [68] > +- org.apache.xbean.asm5-shaded [79] > +- org.apache.commons.collections [67] > > > headers 75 > ... > javax.transaction;resolution:=optional;version="[1.1.0,1.2)", > javax.transaction.xa;resolution:=optional;version="[1.1.0,1.2)", > ... > > Notice how openjpa can't wire to the jta 1.1.0 bundle ONLY when the jta > 1.2.0 bundle is installed, as required by the JMS feature!! > > > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/Karaf-JMS-Feature-breaks-OpenJPA-Feature-tp4042836.html > Sent from the Karaf - User mailing list archive at Nabble.com. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master
