[ODLPARENT-136] SFT java.lang.ClassNotFoundException: org.osgi.service.resolver.ResolutionException Created: 16/Jan/18  Updated: 15/Mar/19  Resolved: 13/Jun/18

Status: Resolved
Project: odlparent
Component/s: SFT
Affects Version/s: None
Fix Version/s: 3.0.4, 3.1.2, 4.0.0

Type: Bug Priority: Highest
Reporter: Michael Vorburger Assignee: Michael Vorburger
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to TSC-117 List of examples where separately rel... Closed

 Description   

Since the odlparent 3.0.0 bump, e.g. https://git.opendaylight.org/gerrit/#/c/65514/6/ fails SFT with:

[INFO] --- maven-surefire-plugin:2.18.1:test (default) @ odl-infrautils-jobcoordinator ---
[INFO] Surefire report directory: /home/vorburger/dev/ODL/git/infrautils/common/features/odl-infrautils-jobcoordinator/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.opendaylight.odlparent.featuretest.SingleFeatureTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.829 sec <<< FAILURE! - in org.opendaylight.odlparent.featuretest.SingleFeatureTest
installFeatureCatchAndLog(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl: file:/home/vorburger/dev/ODL/git/infrautils/common/features/odl-infrautils-jobcoordinator/target/feature/feature.xml, Feature: odl-infrautils-jobcoordinator 1.3.0.SNAPSHOT]  Time elapsed: 11.514 sec  <<< ERROR!
java.lang.ClassNotFoundException: org.osgi.service.resolver.ResolutionException (no security manager: RMI class loader disabled)
	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:219)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1868)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:563)
	at java.lang.Throwable.readObject(Throwable.java:914)
	at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:433)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
	at com.sun.proxy.$Proxy18.remoteCall(Unknown Source)
	at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl$1.invoke(RemoteBundleContextClientImpl.java:102)
	at com.sun.proxy.$Proxy19.call(Unknown Source)
	at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.call(RemoteBundleContextClientImpl.java:290)
	at org.ops4j.pax.exam.container.remote.RBCRemoteTarget.call(RBCRemoteTarget.java:60)
	at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.call(KarafTestContainer.java:652)
	at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:84)
	at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
	at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
	at org.opendaylight.odlparent.featuretest.PerFeatureRunner.run(PerFeatureRunner.java:72)
	at org.opendaylight.odlparent.featuretest.PerRepoTestRunner.runChild(PerRepoTestRunner.java:153)
	at org.opendaylight.odlparent.featuretest.PerRepoTestRunner.runChild(PerRepoTestRunner.java:28)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


Results :

Tests in error: 
  org.osgi.service.resolver.ResolutionException (no security manager: RMI class loader disabled)

instead of with:

[INFO] --- maven-surefire-plugin:2.18.1:test (default) @ odl-infrautils-jobcoordinator ---
[INFO] Surefire report directory: /w/workspace/infrautils-maven-verify-oxygen-mvn33-openjdk8/common/features/odl-infrautils-jobcoordinator/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.opendaylight.odlparent.featuretest.SingleFeatureTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 19.371 sec <<< FAILURE! - in org.opendaylight.odlparent.featuretest.SingleFeatureTest
installFeatureCatchAndLog(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl: file:/w/workspace/infrautils-maven-verify-oxygen-mvn33-openjdk8/common/features/odl-infrautils-jobcoordinator/target/feature/feature.xml, Feature: odl-infrautils-jobcoordinator 1.3.0.SNAPSHOT]  Time elapsed: 18.965 sec  <<< ERROR!
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=odl-infrautils-jobcoordinator; type=karaf.feature; version="[1.3.0.SNAPSHOT,1.3.0.SNAPSHOT]"; filter:="(&(osgi.identity=odl-infrautils-jobcoordinator)(type=karaf.feature)(version>=1.3.0.SNAPSHOT)(version<=1.3.0.SNAPSHOT))" [caused by: Unable to resolve odl-infrautils-jobcoordinator/1.3.0.SNAPSHOT: missing requirement [odl-infrautils-jobcoordinator/1.3.0.SNAPSHOT] osgi.identity; osgi.identity=org.opendaylight.infrautils.jobcoordinator-impl; type=osgi.bundle; version="[1.3.0.SNAPSHOT,1.3.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.opendaylight.infrautils.jobcoordinator-impl/1.3.0.SNAPSHOT: missing requirement [org.opendaylight.infrautils.jobcoordinator-impl/1.3.0.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=org.opendaylight.infrautils.metrics.MetricProvider)"]]
	at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)
	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:349)
	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1188)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1086)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)


Results :

Tests in error: 
  Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=odl-infrautils-jobcoordinator; type=karaf.feature; version="[1.3.0.SNAPSHOT,1.3.0.SNAPSHOT]"; filter:="(&(osgi.identity=odl-infrautils-jobcoordinator)(type=karaf.feature)(version>=1.3.0.SNAPSHOT)(version<=1.3.0.SNAPSHOT))" [caused by: Unable to resolve odl-infrautils-jobcoordinator/1.3.0.SNAPSHOT: missing requirement [odl-infrautils-jobcoordinator/1.3.0.SNAPSHOT] osgi.identity; osgi.identity=org.opendaylight.infrautils.jobcoordinator-impl; type=osgi.bundle; version="[1.3.0.SNAPSHOT,1.3.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.opendaylight.infrautils.jobcoordinator-impl/1.3.0.SNAPSHOT: missing requirement [org.opendaylight.infrautils.jobcoordinator-impl/1.3.0.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=org.opendaylight.infrautils.metrics.MetricProvider)"]]

which is hell of a lot less clear than it should and used to be... like it's basically impossible to figure out what's wrong!



 Comments   
Comment by Michael Vorburger [ 16/Jan/18 ]

This is because the org.osgi.service.resolver.ResolutionException must be available both in the karaf-server-system-under-test-jvm (where it occurs) as well as in the pax-exam-driver-client-jvm (into where it gets sent to via RMI!) in order for the de-serialization to work... but for some reason (I cannot find anymore which change in odlparent caused this... can you?) it is not available on client anymore, with odlparent 3.0.0.

It's easy enough to add; available in org.osgi.compendium as well as felix.framwork.. I've tested that adding osgi.compendium directly to an odl-something POM with single-feature-parent does the trick.

https://git.opendaylight.org/gerrit/#/c/67220/ does (hopefully) the equivalent in odlparent.

Comment by Michael Vorburger [ 12/Jun/18 ]

I've experienced e.g. in c/72223 or c/72904 that this actually was not correctly (c/67220) fixed in odlparent 3.0.3 - so re-opening to get the new fix c/72910, which I've now verified is correct, into all x3 open odlparent branches... with Fix Versions changed accordingly.

Generated at Wed Feb 07 20:27:44 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.