9 Replies Latest reply on Dec 13, 2011 2:47 PM by Jason Porter

    How to avoid loading Drools and Hibernate classes

    Lydia Ares Newbie

      Hi,
      I'm having an issue that only became obvious with the last Weld 1.1.3.Final release which changed the log level for classloading problems:
      On container startup, several ClassNotFoundExceptions are logged, due to missing Drools and Hibernate classes.
      I don't use database persistence nor transactions, so I don't have hibernate in my classpath (my app is running on Tomcat 6).


      The web app is deployed and works. Just these exceptions are a bit annoying.


      Here the stacktrace:




      INFO: Tomcat 6 detected, CDI injection will be available in Servlets and Filters. Injection into Listeners is not supported
      [11:59:23,433] org.jboss.solder.config.xml.bootstrap.XmlConfigExtension [INFO] [] Preventing installation of default bean: org.jboss.seam.faces.transaction.TransactionPhaseListener
      10-nov-2011 11:59:24 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.security.permission.SecurityRuleLoader because of underlying class loading error
      10-nov-2011 11:59:24 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.security.permission.SecurityRuleLoader
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: Lorg/drools/KnowledgeBase;
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.drools.KnowledgeBase
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      [11:59:24,450] org.jboss.solder.core.CoreExtension [INFO] [] Preventing class org.jboss.seam.international.locale.LocaleConfiguration from being installed as bean due to @Veto annotation
      10-nov-2011 11:59:25 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.security.permission.RuleBasedPermissionResolver because of underlying class loading error
      10-nov-2011 11:59:25 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.security.permission.RuleBasedPermissionResolver
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: org/drools/runtime/ObjectFilter
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.drools.runtime.ObjectFilter
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      10-nov-2011 11:59:25 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.transaction.HibernateTransaction because of underlying class loading error
      10-nov-2011 11:59:25 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.transaction.HibernateTransaction
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more




      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.persistence.hibernate.HibernateManagedSessionProxyHandler because of underlying class loading error
      11-nov-2011 13:41:52 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.persistence.hibernate.HibernateManagedSessionProxyHandler
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.persistence.HibernatePersistenceProvider because of underlying class loading error
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.persistence.HibernatePersistenceProvider
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: org/hibernate/TransientObjectException
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.TransientObjectException
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.security.management.picketlink.JpaIdentityStore because of underlying class loading error
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.security.management.picketlink.JpaIdentityStore
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: javax/persistence/criteria/Expression
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: javax.persistence.criteria.Expression
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.persistence.hibernate.SeamManagedHibernateSessionCreated because of underlying class loading error
      11-nov-2011 13:41:53 org.jboss.weld.bootstrap.BeanDeployer addClass
      INFO: catching
      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.persistence.hibernate.SeamManagedHibernateSessionCreated
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:154)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
           at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:168)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:331)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
           at org.apache.catalina.core.StandardService.start(StandardService.java:519)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
           at java.lang.Class.getDeclaredFields0(Native Method)
           at java.lang.Class.privateGetDeclaredFields(Unknown Source)
           at java.lang.Class.getDeclaredFields(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102)
           at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
           at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153)
           at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:48)
           at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:39)
           at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           at com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:151)
           ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
           ... 36 more
      



      This is my beans.xml where I disable transactions:




      <t:SeSynchronizations>
           <s:modifies />
      </t:SeSynchronizations>
      <t:UTTransaction>
           <s:modifies />
      </t:UTTransaction>
      <sc:Veto>
           <s:Qualifier />
      </sc:Veto>
      <ft:TransactionPhaseListener>
           <s:replaces />
           <sc:Veto />
      </ft:TransactionPhaseListener>
      


      May I have to disable more beans to get rid of these exceptions?
      Any tip is welcome. Thank you.



        • 1. Re: How to avoid loading Drools and Hibernate classes
          Jason Porter Master

          For each of those, they should have the @Requires class on them with the needed class. Would you please open a JIRA for these with the attached stack traces?

          • 2. Re: How to avoid loading Drools and Hibernate classes
            Lydia Ares Newbie

            Sorry for the delay..


            I tracked this down a little bit more in detail and it turns out that there two dependency issues with several Seam modules involved:


            In seam-faces there is a class TransactionPhaseListener with @Requires({ org.jboss.seam.persistence.PersistenceContextsImpl, org.jboss.seam.transaction.TransactionExtension })
            So this means that the bean should only be installed if the seam-persistence implementation and the seam-transaction implementation classes are present.
            However, seam-transaction-api.jar and seam-persistence-api.jar have to be present because TransactionPhaseListener directly references classes from these modules.


            And here comes the culprit: seam-persistence-api.jar contains a class SeamManagedHibernateSessionCreated which is an event and depends on Hibernate (org.hibernate.Session). Weld somehow needs to read this event class, doesn't find hibernate and complains.


            So is this a dependency issue with seam-persistence I guess?? Worth a JIRA issue?


            The second issue is the drools dependency of class RuleBasedPermissionResolver in seam-security. This class has @Requires(org.drools.KnowledgeBase) but at the same time directly uses drools classes. My question is if the @Requires annotation is supposed to work event if the class imports classes which are not present at runtime? It doesn't seem so, but I don't believe that this a bug, correct me if I'm wrong. Same thing, not sure about the JIRA issue..


            Thanks for commenting on this Jason, if you have a moment!





            • 3. Re: How to avoid loading Drools and Hibernate classes
              Jason Porter Master

              We need to modify the modules a bit I think. This is probably an issue with the container and loading classes, but we should create archives w/o those dependencies. Could you please create JIRAs for these issues in their respective locations?

              • 4. Re: How to avoid loading Drools and Hibernate classes
                lholmquist Newbie

                Same thing for me when i moved my app to as 7.1.0.Beta1 this morning.  No errors on 7.0.2.Final

                • 5. Re: How to avoid loading Drools and Hibernate classes
                  zeeman Novice

                  I moved to 7.1.Beta1b and get below errors:


                  1-


                  19:51:11,491 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-6) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.security.permission.SecurityRuleLoader
                       at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
                       at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
                       at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
                  Caused by: java.lang.NoClassDefFoundError: Lorg/drools/KnowledgeBase;
                       at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_26]
                       at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_26]
                       at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_26]
                       at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.4.Final.jar:]
                       at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
                       at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184) [guava-r08.jar:]
                       at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153) [guava-r08.jar:]
                       at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69) [guava-r08.jar:]
                       at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
                       at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.4.Final.jar:]
                       ... 11 more
                  Caused by: java.lang.ClassNotFoundException: org.drools.KnowledgeBase from [Module "deployment.ROOT.war:main" from Service Module Loader]
                       at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
                       at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
                       ... 29 more
                  
                  




                  2-


                  19:51:11,269 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-6) catching: org.jboss.weld.resources.spi.ResourceLoadingException: java.lang.LinkageError: Failed to link org/jboss/seam/mail/templating/velocity/CDIVelocityContext (Module "deployment.ROOT.war:main" from Service Module Loader)
                       at org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:76) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:77) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.4.Final.jar:]
                       at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
                       at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
                       at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
                  Caused by: java.lang.LinkageError: Failed to link org/jboss/seam/mail/templating/velocity/CDIVelocityContext (Module "deployment.ROOT.war:main" from Service Module Loader)
                       at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:416)
                       at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260)
                       at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
                       at org.jboss.modules.Module.loadModuleClass(Module.java:500)
                       at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
                       at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
                       at org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:68) [jboss-as-weld-7.1.0.Beta1b.jar:]
                       ... 11 more
                  Caused by: java.lang.NoClassDefFoundError: org/apache/velocity/context/AbstractContext
                       at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_26]
                       at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [:1.6.0_26]
                       at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [:1.6.0_26]
                       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_26]
                       at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:330)
                       at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:411)
                       ... 19 more
                  Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.AbstractContext from [Module "deployment.ROOT.war:main" from Service Module Loader]
                       at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
                       at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
                       at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
                       ... 25 more
                  
                  

                  • 6. Re: How to avoid loading Drools and Hibernate classes
                    zeeman Novice

                    Any update or fix for this? It makes life harder seeing those stack traces. If I change logging level, I could be missing some important warnings/errors.

                    • 7. Re: How to avoid loading Drools and Hibernate classes
                      Jason Porter Master

                      Those are info level messages, and I'm not 100% sure where they're coming from. I know it's desired to have a clean startup, but those ones can safely be ignored.

                      • 8. Re: How to avoid loading Drools and Hibernate classes
                        zeeman Novice

                        Hi Jason, But they show up as stack traces. I got few developers complaining and it makes it takes extra time to read through console to see if they're real errors or not. Like I said even if I change log level config and supress these messages I could be missing other important log message from the same package.


                        Whatever is causing these exceptions should handle them and not let them bubble up if they're not important. Or log them in debug mode.Does not that makes more sense?



                        Jason Porter wrote on Dec 09, 2011 18:32:


                        Those are info level messages, and I'm not 100% sure where they're coming from. I know it's desired to have a clean startup, but those ones can safely be ignored.


                        Click HELP for text formatting instructions. Then edit this text and check the preview.

                        • 9. Re: How to avoid loading Drools and Hibernate classes
                          Jason Porter Master

                          I don't know where they're coming from. The stack trace doesn't tell me which class is being loaded when it can't find the class. The Velocity one is interesting because I know that one is broken up (assuming you're using Seam Mail) so if you don't have Velocity in your project, don't use the module. The Drools one is somewhere in Security, but I'm not sure. Hibernate is all over the place in Persistence. It's actually not Seam that's doing the loading and logging the issues, but it's Weld / AS.


                          The ultimate solution, I think, would be to split those out and add them as other parts of the modules like Seam Mail did. However, that won't be happening for 3.1.0.Final (it's due out later this week).