Tuesday, February 16, 2016

BEA-2162501 Class bytes found, but couldnt define class


<Feb 15, 2016 5:51:24 PM CET> <Error> <Class Loaders> <BEA-2162501> <Class bytes found, but couldnt define class, com.sun.faces.spi.InjectionProviderException due to the following error: {1}
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/sun/faces/spi/InjectionProviderException
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:412)
 at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:366)
 Truncated. see log file for complete stacktrace
> 




This error stems probably by the use of wrong JAR compiled with some JVM different from the one being used. Please check MANIFEST.MF file of the JAR and eventually recompile code.

Check also that the JAR from which you pick up the class (-verbose:class) contains the actual implementation of the class, and not only some abstract interface. You might have to review the way you package your code and define classpaths.

This discussion on JSF and Maven is interesting (scope=provided) http://stackoverflow.com/questions/8081234/how-to-properly-install-and-configure-jsf-libraries-via-maven



No comments: