java.lang.ClassFormatError: JVMCFRE074 no Code attribute specified;class=javax/faces/webapp/FacesServlet, method=<init>()V, pc=0

Jacob picture Jacob · May 29, 2013 · Viewed 11.8k times · Source

I am using JSF 2.0 with Primefaces 3.4.2, Hibernate 4 Final and Spring 3.

When I am deploying an application to Weblogic 10.3.6 using Maven 3 I am getting the following excpetions. How can I resolve this issue?

Any help is highly appreciable.

Target state: deploy failed on Server mgdserver
java.lang.ClassFormatError: JVMCFRE074 no Code attribute specified; class=javax/faces/webapp/FacesServlet, method=<init>()V, pc=0
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBu
ilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBu
ilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter
.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Answer

rgrebski picture rgrebski · May 21, 2015

I had the same exception when I tried to run unit tests, the solution for me was to exclude javaee-api from dependencies:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <classpathDependencyExcludes>
            <classpathDependencyExclude>javax:javaee-api</classpathDependencyExclude>
          </classpathDependencyExcludes>
        </configuration>
      </plugin>