Topic
5 replies Latest Post - ‏2012-08-29T13:32:56Z by PetrH
PetrH
PetrH
82 Posts
ACCEPTED ANSWER

Pinned topic WAS 8.5: ASM library exposed to applications can break several things

‏2012-07-31T21:30:46Z |
We've got an app that makes use of CGLIB (2.2.2) which works fine at WAS 8.0, however at WAS 8.5 we're getting an exception:

java.lang.VerifyError: JVMVRFY007 

final method overridden; class=net/sf/cglib/core/DebuggingClassWriter, method=visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V

further investigation led us to the incompatibility of CGLIB with the loaded ASM library (here org.objectweb.asm.ClassWriter class in particular) being the cause.
We pack the compatible ASM version 3.3.1 in our application, however WAS 8.5 seems to expose its own ASM which is of version 4.0 and that breaks our application:



class load: org.objectweb.asm.ClassWriter from: file:/opt/IBM/WebSphere/AppServer85/plugins/com.ibm.ws.prereq.ow.asm.jar 

class load: org.objectweb.asm.ClassWriter from: file:/opt/IBM/WebSphere/AppServer85/plugins/asm-all-4.0.jar

Also, another ASM related exception that we noticed comes from the Liferay Portal 6.1.0 CE application and it again doesn't occur at WAS 8.0:

java.lang.IncompatibleClassChangeError: org.objectweb.asm.ClassVisitor

Is this really intended behaviour to expose WAS packaged ASM classes to user applications?

For those potentially interested some possible workarounds:
  • use cglib-nodep variant of CGLIB that doesn't depend on separate ASM library (this is what we use for now, but that doesn't apply the 2nd issue where CGLIB isn't involved)
  • define isolated shared library for CGLIB and all used ASM libraries and reference it from your application (that's what we use for the 2nd issue affecting Liferay Portal application)
  • use parent_last classloading order for your application
Updated on 2012-08-29T13:32:56Z at 2012-08-29T13:32:56Z by PetrH
  • bkail
    bkail
    372 Posts
    ACCEPTED ANSWER

    Re: WAS 8.5: ASM library exposed to applications can break several things

    ‏2012-08-06T13:31:59Z  in response to PetrH
    ASM should not be visible to applications, so this appears to be a product defect. I would recommend opening a PMR with IBM.
    • PetrH
      PetrH
      82 Posts
      ACCEPTED ANSWER

      Re: WAS 8.5: ASM library exposed to applications can break several things

      ‏2012-08-06T22:06:45Z  in response to bkail
      Thank you for confirmation. Just opened a PMR for this, will report the result here once there's some.
      • bkail
        bkail
        372 Posts
        ACCEPTED ANSWER

        Re: WAS 8.5: ASM library exposed to applications can break several things

        ‏2012-08-28T11:49:36Z  in response to PetrH
        APAR PM71336 was opened.
  • SystemAdmin
    SystemAdmin
    37422 Posts
    ACCEPTED ANSWER

    Re: WAS 8.5: ASM library exposed to applications can break several things

    ‏2012-08-29T01:52:28Z  in response to PetrH
    Hi all

    I upgraded WAS sever from v6.1 to V8.5 ,and our application met same error also.
    the application is use cglib-2.2 and asm-3.1, for this issue ,should how to resolve it?
    000000f0 ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappedPfwClient' defined in ServletContext resource [/WEB-INF/classes/app-context.xml]: Initialization of bean failed; nested exception is java.lang.VerifyError: JVMVRFY007 final method overridden; class=net/sf/cglib/core/DebuggingClassWriter, method=visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
    Caused by: java.lang.VerifyError: JVMVRFY007 final method overridden; class=net/sf/cglib/core/DebuggingClassWriter, method=visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:262)

    Thanks
    WB
    • PetrH
      PetrH
      82 Posts
      ACCEPTED ANSWER

      Re: WAS 8.5: ASM library exposed to applications can break several things

      ‏2012-08-29T13:32:56Z  in response to SystemAdmin
      Hello, for now you can use one of the 3 workarounds mentioned at the end of my original post.
      The easiest one is to use cglib-nodep (in the case the cglib is the only one using the asm).