Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAX CDI conflicts with org.eclipse.gemini.jpa.(?) [PAXCDI-223] #150

Open
ops4j-issues opened this issue May 23, 2016 · 1 comment
Open
Labels

Comments

@ops4j-issues
Copy link

P created PAXCDI-223

I have a bundle which works with eclipselink via eclipse gemini (? - that's why the problem is also discussed at gemini forum - https://www.eclipse.org/forums/index.php/m/1733050/ ) Although I am not sure that the problem in this. However, the exception occurs only when I add META-INF/beans.bnd to manifest of the jar.

The content of beans.bnd:

Require-Capability org.ops4j.pax.cdi.extension; filter:="(&(extension=pax-cdi-extension)(version>=${version;==;${pax.cdi.version}})(!(version>=${version;=+;${pax.cdi.version}})))", osgi.extender; filter:="(osgi.extender=pax.cdi)"

The list of bundles I install:

Name:org.apache.felix.framework,version:5.4.0
Name:org.ops4j.pax.exam,version:4.2.0
Name:org.ops4j.pax.exam.inject,version:4.2.0
Name:org.ops4j.pax.exam.extender.service,version:4.2.0
Name:osgi.cmpn,version:4.2.0.200908310645
Name:org.ops4j.pax.logging.pax-logging-api,version:1.6.4
Name:org.ops4j.base,version:1.4.0
Name:org.ops4j.pax.swissbox.core,version:1.7.1
Name:org.ops4j.pax.swissbox.extender,version:1.7.1
Name:org.ops4j.pax.swissbox.framework,version:1.7.1
Name:org.ops4j.pax.swissbox.lifecycle,version:1.7.1
Name:org.ops4j.pax.swissbox.tracker,version:1.7.1
Name:org.apache.geronimo.specs.geronimo-atinject_1.0_spec,version:1.0.0
Name:org.ops4j.pax.tipi.junit,version:4.11.0.1
Name:org.ops4j.pax.tipi.hamcrest.core,version:1.3.0.1
Name:org.ops4j.pax.exam.invoker.junit,version:4.2.0
Name:org.apache.felix.scr,version:2.0.2
Name:osgi.enterprise,version:5.0.0.201203141834
Name:javax.annotation-api,version:1.2.0
Name:javax.enterprise.cdi-api,version:1.2.0
Name:javax.el-api,version:3.0.0
Name:org.apache.servicemix.bundles.javax-inject,version:1.0.0.2
Name:javax.interceptor-api,version:1.2.0
Name:org.jboss.weld.osgi-bundle,version:2.2.11.Final
Name:com.google.guava,version:18.0.0
Name:jboss-classfilewriter,version:1.1.2.Final
Name:org.jboss.logging.jboss-logging,version:3.3.0.Final
Name:org.apache.logging.log4j.api,version:2.5.0
Name:slf4j.api,version:1.7.21
Name:slf4j.simple,version:1.7.21
Name:org.apache.xbean.bundleutils,version:4.5.0
Name:org.ops4j.base.lang,version:1.5.0
Name:org.ops4j.pax.cdi.weld,version:1.0.0.RC1
Name:org.ops4j.pax.cdi.spi,version:1.0.0.RC1
Name:org.ops4j.pax.cdi.extension,version:1.0.0.RC1
Name:org.ops4j.pax.cdi.extender,version:1.0.0.RC1
Name:org.ops4j.pax.cdi.api,version:1.0.0.RC1
Name:org.ops4j.pax.swissbox.core,version:1.8.2
Name:org.ops4j.pax.swissbox.lifecycle,version:1.8.2
Name:org.ops4j.pax.swissbox.tracker,version:1.8.2
Name:org.ops4j.pax.swissbox.extender,version:1.8.2
Name:javax.persistence,version:2.1.1.v201509150925
Name:org.eclipse.persistence.antlr,version:3.2.0.v201302191141
Name:org.eclipse.persistence.asm,version:5.0.1.v201405080102
Name:org.eclipse.persistence.core,version:2.6.3.v20160428-59c81c5
Name:org.eclipse.persistence.jpa.jpql,version:2.6.3.v20160428-59c81c5
Name:org.eclipse.persistence.jpa,version:2.6.3.v20160428-59c81c5
Name:org.eclipse.gemini.jpa,version:1.2.0.M1
Name:org.eclipse.gemini.dbaccess.h2,version:1.1.0.RELEASE
Name:org.eclipse.gemini.dbaccess.util,version:1.1.0.201206011559
Name:org.h2,version:1.3.176
Name:org.apache.servicemix.bundles.dbunit,version:2.5.2.1
Name:org.apache.commons.collections,version:3.2.1
+ mybundle

The exception which I get:

ERROR: Bundle mybundle [57] EventDispatcher: Error during dispatch. (java.lang.IllegalArgumentException)
java.lang.IllegalArgumentException
	at org.apache.felix.framework.BundleContextImpl$ServiceObjectsImpl.ungetService(BundleContextImpl.java:584)
	at org.ops4j.pax.cdi.extension.impl.compat.Osgi6ServiceObjectsWrapper.ungetService(Osgi6ServiceObjectsWrapper.java:45)
	at org.ops4j.pax.cdi.extension.impl.ServiceEventBridge.serviceChanged(ServiceEventBridge.java:75)
	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
	at org.apache.felix.framework.Felix.access$000(Felix.java:106)
	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)
	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:883)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:857)
	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:140)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:925)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:774)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:757)
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:1014)
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:915)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1241)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1136)
	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:996)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1175)
	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:120)
	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
	at org.apache.felix.framework.Felix.access$000(Felix.java:106)
	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)
	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:883)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:857)
	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:140)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:925)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:774)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:757)
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:1014)
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.removedService(DependencyManager.java:915)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1241)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1136)
	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:996)
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1175)
	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:120)
	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
	at org.apache.felix.framework.Felix.access$000(Felix.java:106)
	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420)
	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
	at org.eclipse.gemini.jpa.ServicesUtil.unregisterEMFService(ServicesUtil.java:327)
	at org.eclipse.gemini.jpa.ServicesUtil.unregisterEMFServices(ServicesUtil.java:165)
	at org.eclipse.gemini.jpa.GeminiManager.unregisterPersistenceUnits(GeminiManager.java:281)
	at org.eclipse.gemini.jpa.PersistenceBundleExtender.unregisterPersistenceUnitsInBundle(PersistenceBundleExtender.java:321)
	at org.eclipse.gemini.jpa.PersistenceBundleExtender.bundleChanged(PersistenceBundleExtender.java:413)
	at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:916)
	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:835)
	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:517)
	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)
	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2600)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1389)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
	at java.lang.Thread.run(Thread.java:745)

Affects: 1.0.0.RC1
Votes: 0, Watches: 2

@ops4j-issues
Copy link
Author

Marc Schlegel commented

Could you try to move the startorder from all cdi-related bundles to a later stage (after gemini)?

I´ve recently played with pax-cdi myself and had similar issues which where solved by using the right start-order. In my case pax-web has to be started before pax-cdi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant