java - Class ClassFormatError :Absent-Code-attribute-in-method-that-is-not-native -



java - Class ClassFormatError :Absent-Code-attribute-in-method-that-is-not-native -

i have jsp project run on tomcat 6.0.32 , java 6, threw exception

java.lang.classformaterror: absent code attribute in method not native or abstract in class file com/company/secure/account java.lang.classloader.defineclass1(native method) java.lang.classloader.defineclasscond(classloader.java:631) java.lang.classloader.defineclass(classloader.java:615) java.security.secureclassloader.defineclass(secureclassloader.java:141) org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:2818) org.apache.catalina.loader.webappclassloader.findclass(webappclassloader.java:1159) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1647) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1526) org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:128) org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:66) java.lang.class.getdeclaredconstructors0(native method) java.lang.class.privategetdeclaredconstructors(class.java:2389) java.lang.class.getconstructor0(class.java:2699) java.lang.class.newinstance0(class.java:326) java.lang.class.newinstance(class.java:308) org.apache.jasper.servlet.jspservletwrapper.getservlet(jspservletwrapper.java:150) org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:338) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:313) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:260) javax.servlet.http.httpservlet.service(httpservlet.java:717) filters.objectscachefilter.dofilter(objectscachefilter.java:43) filters.filtercach.dofilter(filtercach.java:81) filters.setcharacterencodingfilter.dofilter(setcharacterencodingfilter.java:123)

note total stack trace of root cause available in apache tomcat/6.0.32 logs. apache tomcat/6.0.32

the problem due webapp (in case jsp framework) attempting load classes api-only jar file.

here illustration of problem (though perchance different java ee api):

absent code attribute in method not native or abstract in class file javax/servlet/servletexception

explanation: of java ee apis available in 2 forms; i.e. 2 distinct jar files:

the platform-specific form has code of methods. jar typically part of web container, , included in every web-apps effective classpath default.

the api-only form has methods have had executable code stripped out. jar provided oracle allow compile java ee application code independently of specific java ee implementation.

the problem have set 1 of these api-only jars onto runtime classpath of webapp, , taking precedence on platform-specific jar.

given has "happened suddenly", suspect have been changing maven dependencies project, , (accidentally) made api-only jar file runtime dependency rather compile-time-only dependency.

solution: check webapp's maven (etc) dependencies, or if managing dependencies hand, check jars have set webapp's web-info/lib directory , web container's shared libraries directory.

java tomcat

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -