You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tobias Gierke (JIRA)" <ji...@apache.org> on 2018/05/23 14:11:00 UTC

[jira] [Updated] (WICKET-6552) Spring proxy creation fails with IAE inside ASM ClassReader on JDK10

     [ https://issues.apache.org/jira/browse/WICKET-6552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Gierke updated WICKET-6552:
----------------------------------
    Description: 
Seeing that Wicket 8 just got released I was eager to try out the goodies but got stopped quickly by an IAE on some (but not all) web pages inside cglib/asm (see below for the stacktrace).

Inside WEB-INF/lib we've got:

asm-5.2.jar
 asm-tree-5.2.jar
 asm-util-5.2.jar
 cglib-3.2.5.jar

which is what I would expect looking at the pom.xml for wicket-ioc 8.0.0 so IMHO the classpath is correct. Everything works fine with wicket-ioc 7.10 and JDK 10.0.1 which was using:

asm-5.0.3.jar
 asm-tree-5.0.3.jar
 asm-util-5.0.3.jar
 cglib-3.1.jar

Overriding the dependencies like this:

    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib</artifactId>
      <version>3.2.6</version>
    </dependency>

    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-util</artifactId>
      <version>6.1.1</version>
    </dependency>

 

makes the exception go away.
 I had a brief look at the ClassReader constructor and it seems the IAE gets thrown because of a classfile version not supported by ASM

 

java.lang.IllegalArgumentException
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:63)
 at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:1132)
 at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:630)
 at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
 at net.sf.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
 at net.sf.cglib.proxy.Enhancer.generate(Enhancer.java:492)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
 at net.sf.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
 at net.sf.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
 at net.sf.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
 at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
 at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:480)
 at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:305)
 at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:192)
 at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:166)
 at org.apache.wicket.injection.Injector.inject(Injector.java:111)
 at org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124)
 at org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
 at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 at org.apache.wicket.Component.<init>(Component.java:679)
 at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:178)
 at org.apache.wicket.Page.<init>(Page.java:171)
 at org.apache.wicket.Page.<init>(Page.java:160)
 at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)

  was:
Seeing that Wicket 8 just got released I was eager to try out the goodies but got stopped quickly by an IAE on some (but not all) web pages inside cglib/asm (see below for the stacktrace).

Inside WEB-INF/lib we've got:

asm-5.2.jar
 asm-tree-5.2.jar
 asm-util-5.2.jar
 cglib-3.2.5.jar

which is what I would expect looking at the pom.xml for wicket-ioc 8.0.0 so IMHO the classpath is correct. Everything works fine with wicket-ioc 7.10 and JDK 10.0.1 which was using:
 
 asm-5.0.3.jar
 asm-tree-5.0.3.jar
 asm-util-5.0.3.jar
 cglib-3.1.jar
 
 Overriding the dependencies like this:
 
     <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <version>3.1</version>
     </dependency>
 
     <dependency>
       <groupId>org.ow2.asm</groupId>
       <artifactId>asm-util</artifactId>
       <version>5.0.3</version>
     </dependency>
 
 makes the exception go away.
 I had a brief look at the ClassReader constructor and it seems the IAE gets thrown because of a classfile version not supported by ASM ... funny thing is, ASM 5.0.3 is way older than 5.2 and doesn't crash so it's likely that the generated bytecode passed to this method somehow has a different (older) classfile version..

 

java.lang.IllegalArgumentException
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at org.objectweb.asm.ClassReader.<init>(Unknown Source)
 at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:63)
 at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:1132)
 at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:630)
 at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
 at net.sf.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
 at net.sf.cglib.proxy.Enhancer.generate(Enhancer.java:492)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
 at net.sf.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
 at net.sf.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
 at net.sf.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
 at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
 at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
 at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:480)
 at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:305)
 at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:192)
 at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:166)
 at org.apache.wicket.injection.Injector.inject(Injector.java:111)
 at org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124)
 at org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
 at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
 at org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 at org.apache.wicket.Component.<init>(Component.java:679)
 at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:178)
 at org.apache.wicket.Page.<init>(Page.java:171)
 at org.apache.wicket.Page.<init>(Page.java:160)
 at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)


> Spring proxy creation fails with IAE inside ASM ClassReader on JDK10
> --------------------------------------------------------------------
>
>                 Key: WICKET-6552
>                 URL: https://issues.apache.org/jira/browse/WICKET-6552
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-spring
>    Affects Versions: 8.0.0
>         Environment: Ubuntu 18.04 LTS , 64-bit
> Oracle JDK 10.0.1
>            Reporter: Tobias Gierke
>            Priority: Major
>
> Seeing that Wicket 8 just got released I was eager to try out the goodies but got stopped quickly by an IAE on some (but not all) web pages inside cglib/asm (see below for the stacktrace).
> Inside WEB-INF/lib we've got:
> asm-5.2.jar
>  asm-tree-5.2.jar
>  asm-util-5.2.jar
>  cglib-3.2.5.jar
> which is what I would expect looking at the pom.xml for wicket-ioc 8.0.0 so IMHO the classpath is correct. Everything works fine with wicket-ioc 7.10 and JDK 10.0.1 which was using:
> asm-5.0.3.jar
>  asm-tree-5.0.3.jar
>  asm-util-5.0.3.jar
>  cglib-3.1.jar
> Overriding the dependencies like this:
>     <dependency>
>       <groupId>cglib</groupId>
>       <artifactId>cglib</artifactId>
>       <version>3.2.6</version>
>     </dependency>
>     <dependency>
>       <groupId>org.ow2.asm</groupId>
>       <artifactId>asm-util</artifactId>
>       <version>6.1.1</version>
>     </dependency>
>  
> makes the exception go away.
>  I had a brief look at the ClassReader constructor and it seems the IAE gets thrown because of a classfile version not supported by ASM
>  
> java.lang.IllegalArgumentException
>  at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>  at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>  at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>  at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:63)
>  at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:1132)
>  at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:630)
>  at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
>  at net.sf.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
>  at net.sf.cglib.proxy.Enhancer.generate(Enhancer.java:492)
>  at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
>  at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
>  at net.sf.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
>  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>  at net.sf.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
>  at net.sf.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
>  at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
>  at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
>  at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:480)
>  at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:305)
>  at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:192)
>  at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:166)
>  at org.apache.wicket.injection.Injector.inject(Injector.java:111)
>  at org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124)
>  at org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130)
>  at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
>  at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
>  at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
>  at org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
>  at org.apache.wicket.Component.<init>(Component.java:679)
>  at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:178)
>  at org.apache.wicket.Page.<init>(Page.java:171)
>  at org.apache.wicket.Page.<init>(Page.java:160)
>  at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)