org.osgi.service.blueprint.container.ComponentDefinitionException: org.apache.aries.proxy.UnableToProxyException: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file Proxy82522026_baad_4ad4_a237_03b60effcd46

aries-dev | Declan Cox (JIRA) | 2 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    [jira] [Comment Edited] (ARIES-1342) Aries Proxy Impl fails to proxy a service with covariant type hierarchy in Java 8

    aries-dev | 2 years ago | Declan Cox (JIRA)
    org.osgi.service.blueprint.container.ComponentDefinitionException: org.apache.aries.proxy.UnableToProxyException: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file Proxy82522026_baad_4ad4_a237_03b60effcd46
  2. 0

    I have a simple type hierarchy with a base interface and an extending interface with method overriding (covariant return types). A service implements the derived interface (ColumnDAO - see attached test case). The attached test case illustrates the scenario. In certain situations AriesProxy Impl (more specifically the InterfaceCombiningClassAdapter) fails to properly synthesize the proxy code. In particular it is a combination of the lexical naming of the classes in the hierarchy and Java 8 method access flags that does it. The naming of the classes determines the order in which they are processed since the ProxyClassLoader receives a sorted set of classes when building the proxy. If that order happens to be such that the types are processed in hierarchy order starting with the base type, then all is cool. If not then trouble arises. Why ? Well if a more derived type is processed then it instruments base methods which are marked (in Java 8) with Synthetic and Bridge access flags. In this case the {{visitMethod()}} in {{AbstractWovenProxyAdapter}} does not generate any code but records the fact that this method has been visited. When it subsequently visits the base type, the methods are skipped since they are considered already visited. In the test case running {{javap -verbose ColumnDAO.class}} yields the following (note the base type is named ZanyDAO to force the lexical ordering and thus the error) : {noformat} public abstract org.deklanowski.aries.dao.ColumnBatch<R, C, V> prepareBatch(); flags: ACC_PUBLIC, ACC_ABSTRACT Signature: #9 // ()Lorg/deklanowski/aries/dao/ColumnBatch<TR;TC;TV;>; public abstract org.deklanowski.aries.dao.ColumnQuery<R, C, V> createQuery(); flags: ACC_PUBLIC, ACC_ABSTRACT Signature: #12 // ()Lorg/deklanowski/aries/dao/ColumnQuery<TR;TC;TV;>; public org.deklanowski.aries.dao.Batch prepareBatch(); flags: ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokeinterface #1, 1 // InterfaceMethod prepareBatch:()Lorg/deklanowski/aries/dao/ColumnBatch; 6: areturn LineNumberTable: line 3: 0 LocalVariableTable: Start Length Slot Name Signature 0 7 0 this Lorg/deklanowski/aries/dao/ColumnDAO; LocalVariableTypeTable: Start Length Slot Name Signature 0 7 0 this Lorg/deklanowski/aries/dao/ColumnDAO<TR;TC;TV;>; public org.deklanowski.aries.dao.Query createQuery(); flags: ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokeinterface #2, 1 // InterfaceMethod createQuery:()Lorg/deklanowski/aries/dao/ColumnQuery; 6: areturn LineNumberTable: line 3: 0 LocalVariableTable: Start Length Slot Name Signature 0 7 0 this Lorg/deklanowski/aries/dao/ColumnDAO; LocalVariableTypeTable: Start Length Slot Name Signature 0 7 0 this Lorg/deklanowski/aries/dao/ColumnDAO<TR;TC;TV;>; {noformat} The logic in the aforementioned {{AbstractWovenProxyAdapter.visitMethod()}} on line 341 is as follows: {noformat} if ((access & (ACC_STATIC | ACC_PRIVATE | ACC_SYNTHETIC | ACC_NATIVE | ACC_BRIDGE)) == 0 && !!!name.equals("<init>") && !!!name.equals("<clinit>")) { <snip> {noformat} The if statement evaluates to false and no code is generated though the methods are recorded as having been visited.

    Apache's JIRA Issue Tracker | 2 years ago | Declan Cox
    org.osgi.service.blueprint.container.ComponentDefinitionException: org.apache.aries.proxy.UnableToProxyException: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file Proxy82522026_baad_4ad4_a237_03b60effcd46
  3. 0

    I keep getting these errors on deploy

    Stack Overflow | 2 years ago
    java.lang.ClassFormatError: Invalid method attribute name index 60672 in class file com/sun/enterprise/security/provider/PolicyParser
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Oracle HFM Java API

    Stack Overflow | 1 year ago | MartinM
    java.lang.ClassFormatError: Truncated class file
  6. 0

    [Scala 2.11.1] Multiple `isDefinedAt` generated by compiler when using tagged types

    Google Groups | 3 years ago | amsayk
    java.lang.ClassFormatError: Duplicate method name&signature in class file main$$anonfun$d$1

    14 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassFormatError

      Absent Code attribute in method that is not native or abstract in class file Proxy82522026_baad_4ad4_a237_03b60effcd46

      at java.lang.ClassLoader.defineClass1()
    2. Java RT
      ClassLoader.defineClass
      1. java.lang.ClassLoader.defineClass1(Native Method)[:1.8.0_45]
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:760)[:1.8.0_45]
      2 frames
    3. Apache Aries Proxy Service
      AbstractProxyManager.createDelegatingProxy
      1. org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.createProxyClass(ProxyClassLoader.java:162)
      2. org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:95)[20:org.apache.aries.proxy.impl:1.0.4]
      3. org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:80)[20:org.apache.aries.proxy.impl:1.0.4]
      4. org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)[20:org.apache.aries.proxy.impl:1.0.4]
      5. org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:40)[20:org.apache.aries.proxy.impl:1.0.4]
      5 frames
    4. Apache Aries Blueprint Core
      AbstractRecipe$1.call
      1. org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:338)[12:org.apache.aries.blueprint.core:1.4.3]
      2. org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:106)[12:org.apache.aries.blueprint.core:1.4.3]
      3. org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[12:org.apache.aries.blueprint.core:1.4.3]
      3 frames
    5. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45]
      1 frame
    6. Apache Aries Blueprint Core
      BlueprintExtender.modifiedBundle
      1. org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[12:org.apache.aries.blueprint.core:1.4.3]
      2. org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[12:org.apache.aries.blueprint.core:1.4.3]
      3. org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[12:org.apache.aries.blueprint.core:1.4.3]
      4. org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:682)[12:org.apache.aries.blueprint.core:1.4.3]
      5. org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)[12:org.apache.aries.blueprint.core:1.4.3]
      6. org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[12:org.apache.aries.blueprint.core:1.4.3]
      7. org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[12:org.apache.aries.blueprint.core:1.4.3]
      8. org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[12:org.apache.aries.blueprint.core:1.4.3]
      9. org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[12:org.apache.aries.blueprint.core:1.4.3]
      9 frames
    7. Apache Aries Util
      BundleHookBundleTracker$BundleEventHook.event
      1. org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[21:org.apache.aries.util:1.1.0]
      2. org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[21:org.apache.aries.util:1.1.0]
      3. org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[21:org.apache.aries.util:1.1.0]
      4. org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[21:org.apache.aries.util:1.1.0]
      5. org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[21:org.apache.aries.util:1.1.0]
      5 frames
    8. Apache Felix Framework
      BundleImpl.start
      1. org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)[org.apache.felix.framework-5.0.1.jar:]
      2. org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730)[org.apache.felix.framework-5.0.1.jar:]
      3. org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:485)[org.apache.felix.framework-5.0.1.jar:]
      4. org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4544)[org.apache.felix.framework-5.0.1.jar:]
      5. org.apache.felix.framework.Felix.startBundle(Felix.java:2166)[org.apache.felix.framework-5.0.1.jar:]
      6. org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977)[org.apache.felix.framework-5.0.1.jar:]
      7. org.apache.felix.framework.BundleImpl.start(BundleImpl.java:964)[org.apache.felix.framework-5.0.1.jar:]
      7 frames
    9. org.apache.karaf
      FeaturesServiceImpl$1.call
      1. org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)[8:org.apache.karaf.features.core:4.0.0]
      2. org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:830)[8:org.apache.karaf.features.core:4.0.0]
      3. org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)[8:org.apache.karaf.features.core:4.0.0]
      4. org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)[8:org.apache.karaf.features.core:4.0.0]
      4 frames
    10. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45]
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_45]
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_45]
      4. java.lang.Thread.run(Thread.java:745)[:1.8.0_45]
      4 frames