cancel
Showing results for 
Search instead for 
Did you mean: 

ClassFormatError after importing license file on Hybris 5.7.x

SimonLBarker
Associate
Associate
0 Kudos

We've encountered an issue after importing a production license into Hybris

On server startup the following exception is seen in the console - the issue does not occur with the standard DEV license.

 SEVERE: Exception sending context initialized event to listener instance of class de.hybris.platform.spring.HybrisContextLoaderListener
 INFO   | jvm 1    | srvmain | 2016/05/19 12:16:07.100 | java.lang.ClassFormatError: Illegal local variable table length 27 in method com.sap.security.core.server.likey.utils.Utils.main([Ljava/lang/String;)V
 INFO   | jvm 1    | srvmain | 2016/05/19 12:16:07.100 | 
 at com.sap.security.core.server.likey.LicenseChecker.getAllLicenses(LicenseChecker.java:87)
 INFO   | jvm 1    | srvmain | 2016/05/19 12:16:07.100 | 
 at de.hybris.platform.licence.internal.LicenseFactory.tryFindSAPLicenseKey(LicenseFactory.java:61)
 INFO   | jvm 1    | srvmain | 2016/05/19 12:16:07.100 | 
 at de.hybris.platform.licence.internal.LicenseFactory.getCurrentLicense(LicenseFactory.java:45)
 INFO   | jvm 1    | srvmain | 2016/05/19 12:16:07.100 | 
 at de.hybris.platform.core.MasterTenant.<init>(MasterTenant.java:83)
 

Accepted Solutions (0)

Answers (1)

Answers (1)

SimonLBarker
Associate
Associate
0 Kudos

Posting an answer to my own question as this is what we've discovered together with the fix we've used

Quick answer

Add -Xverify:none to tomcat.generaloptions

Background

This error is generated by java when an attempt is made to load a new class, it performs checks to ensure the class is formed correctly and that the bytecode in the classes are un-modified.

Generally this is ok, however if agents are added to the JVM (as in our case), the bytecode is often modified to allow additional code to be added to the class to instrument it for reporting / monitoring purposes.

To enable these classes to load JVM 7 has the flag XX:-UseSplitVerifier, this tells the JVM to use a less strict check on the classes being loaded and enable instrumented classes to load.

In our tomcat.generaloptions we have the XX:-UseSplitVerifier flag added, however as of java 8 this flag is deprecated, and has no effect. So the strict class checking is being performed and the SAP license checker class is not able to be loaded.

The new flag -Xverify:none replaces XX:-UseSplitVerifier in Java 8 and is now the supported flag for disabling the class loading checker.