ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/HttpConstraintElement

1,222 views
Skip to first unread message

JuniorL

unread,
Aug 14, 2014, 11:08:43 AM8/14/14
to google-we...@googlegroups.com
Hi,

To my environment

  - Eclipse version 4.3.0
  - Google Plugin for Eclipse version 3.5.1
  - m2e  version 1.4.0
  - gwt-maven-plugin version 2.6.1
  - maven-war-plugin  version 2.1

My problem:

I am developing a maven project consisting of 3 modules. Two of them are GWT modules.
I managed to successfully compile the whole project (using gwt-maven-plugin) and building the
war (using maven-war-plugin).
When trying to launch the (GWT) application in eclipse I get the following exception:

Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/HttpConstraintElement
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.createWebAppContext(JettyLauncher.java:744)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:711)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:522)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1104)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:844)
    at com.google.gwt.dev.DevMode.main(DevMode.java:322)

After Googling, I found out that I need a Javaee implementation, since java-api.jar contains no implementation.
This makes me really confused. I thought that the internal server used by GWT will provide a default implementation.
Can someone give me a hint on how to fix this problem.
Any idea is welcome.

Regards
Junior

Thomas Broyer

unread,
Aug 17, 2014, 10:42:43 AM8/17/14
to google-we...@googlegroups.com
Make sure you declare your servlets dependency with the provided scope. And if you still have the problem, you could switch to another servlets dependency (from jetty, tomcat, glass dish, etc.) or configure the gwt-maven-plugin to put GWT first in the classpath, so that the servlets classes it bundles are picked rather than those from your declared dependency.
Reply all
Reply to author
Forward
0 new messages