0 Replies Latest reply on Apr 4, 2011 5:52 AM by Albert Kam

    Weld 1.1.0-Final : Cannot inherit from final class

    Albert Kam Newbie

      I decided to try out the newer Weld, which is 1.1.0-Final, and here' the maven i added successfully:




                <dependency>
                     <groupId>org.jboss.weld.servlet</groupId>
                     <artifactId>weld-servlet</artifactId>
                     <version>1.1.0.Final</version>
                     <!-- <version>1.0.1-Final</version> -->
                     <type>jar</type>
                     <scope>compile</scope>
                </dependency>
      




      Restarting my tomcat on my newly deployed webapp with the newer Weld displays this in the log file :




          SEVERE: Error deploying web application directory primebert
          java.lang.VerifyError: Cannot inherit from final class
               at java.lang.ClassLoader.defineClass1(Native Method)
               at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
               at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
               at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
               at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
               at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
               at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
               at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
               at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1947)
               at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1910)
               at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1797)
               at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1756)
               at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1742)
               at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1245)
               at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:874)
               at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
               at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
               at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
               at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)
               at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
               at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
               at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
               at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
               at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1044)
               at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:967)
               at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
               at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1302)
               at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
               at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
               at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
               at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:343)
               at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:323)
               at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1043)
               at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
               at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
               at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
               at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
               at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
               at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
               at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
               at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:724)
               at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
               at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
               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.catalina.startup.Bootstrap.start(Bootstrap.java:304)
               at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
      
      



      So basically, using Weld 1.0.1-Final, this error doesnt happen. Switching to 1.1.0.Final, this happens.


      I tried finding all my java source which has the final class, and tried removing the final words, and redeploy, but still, with the same error.


      Any ideas why this is happening ?


      Thank you !