Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6628

wicket-ioc needs to use ASM 7 and CGLIB 3.2.10 to be compatible with JDK11

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.2.0
    • Fix Version/s: 8.3.0
    • Component/s: wicket-ioc
    • Labels:
      None

      Description

      Trying to use Wicket 8.2. (more specificially, wicket-ioc 8.2 and the @SpringBean annotation) on OpenJDK 11 crashes when the application was also compiled to JDK11 bytecode (but works fine when compiling with --target 10 and running on OpenJDK 11).

      Java version:

      openjdk version "11" 2018-09-25
      OpenJDK Runtime Environment 18.9 (build 11+28)
      OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
      

       

      Crash caused by outdated asm-utils version:

          java.lang.UnsupportedOperationException
                  at org.objectweb.asm.ClassVisitor.visitNestMemberExperimental(ClassVisitor.java:248)
                  at org.objectweb.asm.ClassReader.accept(ClassReader.java:651)
                  at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
                  at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:70)
                  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)
      

      After upgrading to asm-utils 7.0 we still got another crash caused by the outdated cglib dependency:

      java.lang.UnsupportedOperationException: This feature requires ASM7
      at org.objectweb.asm.ClassVisitor.visitNestMember(ClassVisitor.java:236)
      at org.objectweb.asm.ClassReader.accept(ClassReader.java:651)
      at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
      at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:70)
      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:191)

      Adding the following to our pom.xml fixed the crashes:

          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-util</artifactId>
            <version>7.0</version>
          </dependency>
          <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>3.2.10</version>
          </dependency>
      

       

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Tzvetanov Grigorov
              Reporter:
              tgierke2342 Tobias Gierke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: