Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-14195

Update javassist from 3.23.2-GA to 3.27.0-GA

XMLWordPrintable

    • Icon: Component Upgrade Component Upgrade
    • Resolution: Done
    • Icon: Major Major
    • 25.0.0.Final
    • 21.0.1.Final, 22.0.0.Alpha1
    • None
    • None

      Current WF has javassist library that doesn't fully support JDK11
      Problem is ConstPool#readOne method where is missing support for constant 17. This support was added in later versions of Javassist.

      this lead for us to failed test that is run in Arquillian 1.6.0 when is used jacoco 0.8.6.
      Test are run via maven and maven compiler has set source/target compiler level to 11. When it was 1.8 all was fine.

      It seams that during instrumentation with jacoco is added this constant to classes so later our test failed because Reflections cant create class.

      Caused by: org.reflections.ReflectionsException: could not create class file from InstancesAndTypesOrderedSetupService.class
      	at deployment.test-application-ear.ear//org.reflections.adapters.JavassistAdapter.getOrCreateClassObject(JavassistAdapter.java:109)
      	at deployment.test-application-ear.ear//org.reflections.adapters.JavassistAdapter.getOrCreateClassObject(JavassistAdapter.java:1)
      	at deployment.test-application-ear.ear//org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:28)
      	... 169 more
      Caused by: java.io.IOException: invalid constant type: 17 at 355
      	at org.javassist//javassist.bytecode.ConstPool.readOne(ConstPool.java:1355)
      	at org.javassist//javassist.bytecode.ConstPool.read(ConstPool.java:1279)
      	at org.javassist//javassist.bytecode.ConstPool.<init>(ConstPool.java:198)
      	at org.javassist//javassist.bytecode.ClassFile.read(ClassFile.java:794)
      	at org.javassist//javassist.bytecode.ClassFile.<init>(ClassFile.java:185)
      	at deployment.test-application-ear.ear//org.reflections.adapters.JavassistAdapter.getOrCreateClassObject(JavassistAdapter.java:107)
      	... 171 more
      

      I used from another issue this 2 lines to print used javassist version.

            clazz = Class.forName("javassist.util.proxy.ProxyFactory");
            System.out.println(clazz.getProtectionDomain().getCodeSource());
      
      result in log:
      09:34:16,882 INFO  [stdout] (default task-2) (jar:file:/D:/ide/wildfly/wildfly-21.0.0.Final/modules/system/layers/base/org/javassist/main/javassist-3.23.2-GA.jar!/ <no signer certificates>)
      

      I tried exclude javassist from deployment in jboss-deployment-structure.xml. Next I tried add it via Arquillian to test-ear but always it use WF provided javassist.
      Not sure if provided custom module will take precedence.

      I tried replace javassist in main slot with 3.27.0-GA now and the test works fine. But I understood that there could be other places that are maybe still require javassist and should be checked.

            sgrinove Sanne Grinovero
            lumi@centrum.cz Lumir Navrat (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: