java.lang.ClassFormatError: Weaving hook failed | Community
Skip to main content
RitendraS11
Level 5
July 1, 2026
Question

java.lang.ClassFormatError: Weaving hook failed

  • July 1, 2026
  • 1 reply
  • 128 views

Hi All,

I am using the below setup locally - 

AEM 6.5.2.LTS (AEM 6.5 LTS SP2 - JDK 21 supported)

Java version - JDK 21 (21.0.11)

I am getting Error very frequently in my local setup, where crx/de and system/console becomes inaccessible and in order to resolve that, i need to remove sling/felix/.cache.lock file. 

 

Error description -

HTTP ERROR 500 java.lang.ClassFormatError: Weaving hook failed.

URI: /system/console/bundles
STATUS: 500
MESSAGE: java.lang.ClassFormatError: Weaving hook failed.
SERVLET: org.apache.felix.http.base.internal.dispatch.DispatcherServlet-4807c955
CAUSED BY: java.lang.ClassFormatError: Weaving hook failed.
CAUSED BY: java.lang.IllegalArgumentException: Unsupported class file major version 65

 

From Error, it points at JAVA version - But, this is already checked. Also, when i delete sling/felix directory - upon restart AEM, AEM didn’t start properly and only one directory gets created under sling/felix as bundle0.

 

Also, in sling.properties, i have this line addded - org.osgi.framework.bootdelegation=sun.*,com.sun.*,jdk.internal.reflect,jdk.internal.reflect.*

 

Any pointers to resolve the issue would be appreciated.

1 reply

P R Vaspari
Adobe Employee
Adobe Employee
July 7, 2026

This does not look like a .cache.lock problem. The key line is:
“Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65”.

Major version 65 is Java 21 bytecode. The failing component is the Aries SPI Fly dynamic weaving hook using ASM 9.4.0, which cannot fully process Java 21 class files. So AEM may be running on a supported JDK, but one of the bytecode-weaving/runtime libraries in the instance is not Java 21-capable.

 

Recommended checks:

Do not keep deleting only .cache.lock as a fix
That only releases a stale Felix lock. It does not fix the weaving failure. Also, delete it only when AEM is fully stopped.

Check the exact bundle versions
Look in error.log for:

  1. org.apache.aries.spifly.dynamic.bundle
    org.objectweb.asm

If you see org.objectweb.asm:9.4.0, that is suspicious for Java 21. Java 21 support requires newer ASM, typically ASM 9.5+.

  1. Find who is bringing old ASM / SPI Fly
    In your project dependencies, check:

    mvn dependency:tree | grep -E "asm|aries|spifly"

    If custom bundles embed/export old ASM, Aries SPI Fly, ByteBuddy, CGLIB, Jacoco, Mockito, Groovy, etc., update them for Java 21 compatibility.
     

  2. Try Java 17 as a diagnostic
    Since AEM 6.5 LTS supports Java 17 and Java 21, run the same local instance with JDK 17. If the error disappears, it strongly confirms a Java 21 bytecode tooling incompatibility.