dilluns, 17 de desembre del 2012

java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Absent Code attribute in method that is not native or abstract in class file FILE_NAME

Avui m'ha apregut aquest error en intentar desplegar un projecte fet amb JSF 2.0 i Hibernate sobre Tomcat 6:


SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Absent Code attribute in method that is not native or abstract in class file ddgi/exposicionsIteAdm/contJSF/VideosnController$VideosnControllerConverter
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:514)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1473)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:824)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:680)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Absent Code attribute in method that is not native or abstract in class file ddgi/exposicionsIteAdm/contJSF/VideosnController$VideosnControllerConverter
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:379)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
... 33 more
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file ddgi/exposicionsIteAdm/contJSF/VideosnController$VideosnControllerConverter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1850)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at com.sun.faces.util.Util.loadClass(Util.java:281)
at com.sun.faces.config.AnnotationScanner.processClassList(AnnotationScanner.java:304)
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:127)
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:846)
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:798)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:350)
... 34 more


La solució? Doncs una recerca a Google només reflecteix problemes de Maven, però en el meu cas no estic usant Maven, sinó Ant (via NetBeans), pel que no em serveix.

Al final, la solució ha consistit en:

  1. Matar tots els processos Java
  2. Iniciar NetBeans
  3. Recompilar completament el projecte
  4. Redesplegar-lo
La solució ha estat simple, però fora bo tenir una explicació millor....