[ODLPARENT-43] org.osgi.service.blueprint.container.ComponentDefinitionException Caused by: java.lang.RuntimeException at org.objectweb.asm.MethodVisitor.visitParameter Created: 24/Aug/16  Updated: 24/Jan/18  Resolved: 07/Mar/17

Status: Resolved
Project: odlparent
Component/s: General
Affects Version/s: None
Fix Version/s: None

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

Operating System: All
Platform: All


External issue ID: 6523

 Description   

Karaf log has a lot of these kind of errors:

2016-08-24 14:46:30,874 | ERROR | ime-limited test | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.6.1 | Unable to start blueprint container for bundle org.opendaylight.controller.netty-threadgroup-config/0.6.0.SNAPSHOT
org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.RuntimeException
at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:123)
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:955)
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:929)
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:910)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:844)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255)
at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:233)
at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:158)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:568)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:395)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:276)
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:300)
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:269)
at org.apache.aries.blueprint.container.BlueprintExtender.access$900(BlueprintExtender.java:68)
at org.apache.aries.blueprint.container.BlueprintExtender$BlueprintContainerServiceImpl.createContainer(BlueprintExtender.java:602)
at org.opendaylight.controller.blueprint.BlueprintBundleTracker.modifiedBundle(BlueprintBundleTracker.java:178)
at org.opendaylight.controller.blueprint.BlueprintBundleTracker.addingBundle(BlueprintBundleTracker.java:159)
at org.opendaylight.controller.blueprint.BlueprintBundleTracker.addingBundle(BlueprintBundleTracker.java:51)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:414)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[karaf-org.osgi.core.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)[karaf-org.osgi.core.jar:]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2092)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
at org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:516)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:474)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:415)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:390)
at Proxy6f850cc9_21fb_49f2_a56b_4bdf6d389f68.installFeature(Unknown Source)
at org.opendaylight.odlparent.featuretest.SingleFeatureTest.installFeature(SingleFeatureTest.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101]
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)[53:org.ops4j.pax.tipi.junit:4.12.0.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.apache.aries.proxy.impl.common.AbstractWovenProxyAdapter.readClass(AbstractWovenProxyAdapter.java:683)
at org.apache.aries.proxy.impl.interfaces.InterfaceCombiningClassAdapter.generateBytes(InterfaceCombiningClassAdapter.java:109)
at org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.createProxyClass(ProxyClassLoader.java:156)
at org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:95)
at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:80)
at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)
at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:40)
at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:332)
at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:107)
... 54 more



 Comments   
Comment by Michael Vorburger [ 24/Aug/16 ]

I've analysed this; it seems to have something to do with (likely an older version of) the ASM bytecode manipulation library used by Apache Aries in Karaf (not directly OpenDaylight...) not being able to deal with the Java 8 javac -parameters option, introduced in https://git.opendaylight.org/gerrit/#/c/42515/.

The best solution would be to upgrade to the latest available version of ASM, assuming that they have done a fix to make it Java 8 compliant. It would be to have a reference for this.

We can see e.g. in an ODL Karaf's assembly/system/org/ow2/asm/asm-all (e.g. netvirt/vpnservice/distribution/karaf/target/assembly/system/org/ow2/asm/asm-all) that we appear to be on 5.0.3, which isn't that ancient actually; http://asm.ow2.org shows a Recent News 5 March 2016: release of ASM 5.1.

I've raised issue http://forge.ow2.org/tracker/?func=detail&aid=317771&group_id=23&atid=100023 on http://forge.ow2.org/tracker/?group_id=23 to see if the ASM folks have something to say about support for Java 8 -parameters (either confirm it's fixed in ASM 5.1, and release a new version with a fix for it).

Comment by Michael Vorburger [ 24/Aug/16 ]

I've meanwhile understood, from https://issues.gradle.org/browse/GRADLE-3157, that this probably happens when using ASM and passing Opcodes.ASM4 instead of newer Opcodes.ASM5 into ASM (MethodVisitor constructor).

As such this problem must be solved in the library calling ASM, as ASM already does support Java 8 javac -parameters, when called correctly.

In our case for ODL, this means upgrading not ASM but Apache Aries Blueprint and/or Apache Aries Proxy. This commit https://github.com/apache/aries/commit/9a9631e98aa1ca30291a77753417432d63fd4c37 for this issue https://issues.apache.org/jira/browse/ARIES-1280 looks like it should have taken care of this, a long time ago already. Wonder why we're still hitting it..

Comment by Michael Vorburger [ 24/Aug/16 ]

> We can see e.g. in an ODL Karaf's assembly/system (...) that we appear to be on 5.0.3

What doesn't help here to debug this is that somehow we're using an asm-all-5.1.jar on the CP during development and the 5.0.3 during runtime - or are we pulling an ANCIENT ASM 1.5.3, using same packages, from the com.springsource.org.objectweb.asm-1.5.3.jar which we see in system/org/objectweb/asm/com.springsource.org.objectweb.asm/1.5.3 ? That might explain the discrepancy.

Comment by Michael Vorburger [ 24/Aug/16 ]

> Karaf log has a lot of these kind of errors:

Actually so far I've only seen this in the Karaf log of SingleFeatureTest runs of features projects; e.g. in netvirt/vpnservice/features/target/surefire-reports/org.opendaylight.odlparent.featuretest.SingleFeatureTest-output.txt

Interestingly, a "normal" Karaf distribution does not show this. Priority is thus not quite as blocking as I initially thought. It would still be good to fix though.

Suggested next step, try to get rid of com.springsource.org.objectweb.asm-1.5.3.jar to see if that helps. It appears to be pulled by karaf-3.0.6.pom & enterprise-3.0.7-features.xml ?

Comment by Michael Vorburger [ 24/Aug/16 ]

https://issues.jboss.org/browse/ENTESB-5393

https://issues.apache.org/jira/browse/ARIES-1186

Comment by Vratko Polak [ 24/Aug/16 ]

> Interestingly, a "normal" Karaf distribution does not show this.

Is this because Integration/Distribution features-* modules do NOT inherit from features-parent? They use the old way using opendaylight-karaf-empty which is built using karaf-parent which performs explicit hacks related to org.apache.aries.proxy.impl [0].

I checked, the 1.0.4 -> 1.0.5 hack is still relevant for Carbon snapshot builds. Unfortunately I do not recall what happens if the hack is removed, so this issue may be something entirely different.

[0] https://git.opendaylight.org/gerrit/gitweb?p=odlparent.git;a=blob;f=karaf/karaf-parent/pom.xml;h=6944d493de907c5c809c569fd8ed99bc04265e70;hb=refs/heads/master#l360

Comment by Michael Vorburger [ 25/Aug/16 ]

> I checked, the 1.0.4 -> 1.0.5 hack is still relevant for Carbon snapshot
> builds. Unfortunately I do not recall what happens if the hack is removed

Aha. OK, as far as I now understand, that "hack", which replaces org.apache.aries.proxy.impl/1.0.4 with org.apache.aries.proxy.impl/1.0.5 should never be removed, as that is the right thing to do to prevent this problem from occurring. That gets us Apache Aries Proxy 1.0.5 instead of 1.0.4, like issue KARAF-4449 did for Karaf 4, for our ODL Karaf 3, as we need to benefit from the ARIES-1280 fix.

>> only seen this in the Karaf log of SingleFeatureTest runs of features
>> Interestingly, a "normal" Karaf distribution does not show this.
> Is this because Integration/Distribution features-* modules do NOT inherit

IMHO the only thing we must thus do here to resolve this is to apply the same (hack) to whatever controls the version of org.apache.aries.proxy.impl in the features projects which run the SingleFeatureTest, and then we're done here. (Or we need to link this issue to some other planned work which would ensure that the same Karaf is used for both?)

I'm unclear how / where to do this - Vratko or Stephen, do you know?

Comment by Vratko Polak [ 08/Sep/16 ]

> apply the same (hack) to whatever controls the version of org.apache.aries.proxy.impl in the features projects which run the SingleFeatureTest

Yes, but it may take a while for someone to figure out how that could be done.
Possibly (waiting and) upgrading to karaf 3.0.x which already comes with higher version of org.apache.aries.proxy.impl is easier to do.

Comment by Michael Vorburger [ 01/Dec/16 ]

This now has to be solved in order for everyone to be able to benefit from https://git.opendaylight.org/gerrit/#/c/48901/ .. only I alone still don't know to, based on above - #anyone #help - please!

Comment by Vratko Polak [ 02/Dec/16 ]

An attempt at a sub-optimal but quick Carbon fix:
https://git.opendaylight.org/gerrit/48934

Comment by Michael Vorburger [ 05/Dec/16 ]

> An attempt at a sub-optimal but quick Carbon fix:
> https://git.opendaylight.org/gerrit/48934

I've just tested c/48934 and can confirm this solves the problem above!

Comment by Robert Varga [ 07/Dec/16 ]

Workaround merged, this will be fixed properly with the Karaf4 upgrade.

Comment by Michael Vorburger [ 07/Mar/17 ]

FTR: ODLPARENT-74 has something vaguely related.

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