3 Replies Latest reply on Feb 9, 2012 9:46 AM by Jeffrey Jia

    Problem with seam-persistence  seam 3.1 tomcat 7

    Jeffrey Jia Newbie

      When ejb-api.jar  not in lib path , I  get Exception  :

       

      Feb 09, 2012 3:12:57 PM org.apache.catalina.core.AprLifecycleListener init

      INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib64/firefox:/usr/lib64/firefox/plugins:/usr/lib64/firefox:/usr/lib64/firefox:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

      Feb 09, 2012 3:12:58 PM org.apache.tomcat.util.digester.SetPropertiesRule begin

      WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:weld2' did not find a matching property.

      Feb 09, 2012 3:12:58 PM org.apache.coyote.AbstractProtocol init

      INFO: Initializing ProtocolHandler ["http-bio-8080"]

      Feb 09, 2012 3:12:58 PM org.apache.coyote.AbstractProtocol init

      INFO: Initializing ProtocolHandler ["ajp-bio-8009"]

      Feb 09, 2012 3:12:58 PM org.apache.catalina.startup.Catalina load

      INFO: Initialization processed in 680 ms

      Feb 09, 2012 3:12:58 PM org.apache.catalina.core.StandardService startInternal

      INFO: Starting service Catalina

      Feb 09, 2012 3:12:58 PM org.apache.catalina.core.StandardEngine startInternal

      INFO: Starting Servlet Engine: Apache Tomcat/7.0.22

      Feb 09, 2012 3:12:58 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom

      INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [181] milliseconds.

      Feb 09, 2012 3:13:02 PM org.jboss.weld.bootstrap.WeldBootstrap <clinit>

      INFO: WELD-000900 1.1.5 (Final)

      Feb 09, 2012 3:13:02 PM org.jboss.weld.bootstrap.WeldBootstrap startContainer

      INFO: WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.

      -------------------

      2012-02-09 15:13:02,952 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Solder Config XML provider starting...

      2012-02-09 15:13:02,953 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Loading XmlDocumentProvider: org.jboss.solder.config.xml.bootstrap.ResourceLoaderXmlDocumentProvider

      2012-02-09 15:13:02,957 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Reading XML file: file:/home/Jeffrey/tmp/deploys/wtpwebapps/weld2/WEB-INF/beans.xml

      2012-02-09 15:13:02,960 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Reading XML file: file:/home/Jeffrey/tmp/deploys/wtpwebapps/weld2/WEB-INF/classes/META-INF/seam-beans.xml

      2012-02-09 15:13:02,971 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Reading XML file: jar:file:/home/Jeffrey/tmp/deploys/wtpwebapps/weld2/WEB-INF/lib/seam-persistence.jar!/META-INF/beans.xml

      2012-02-09 15:13:02,972 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Reading XML file: jar:file:/home/Jeffrey/tmp/deploys/wtpwebapps/weld2/WEB-INF/lib/seam-transaction.jar!/META-INF/beans.xml

      2012-02-09 15:13:02,974 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Adding XML Defined Bean: org.jboss.seam.transaction.SeSynchronizations

      2012-02-09 15:13:02,983 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Adding XML Defined Bean: org.jboss.seam.transaction.EntityTransaction

      beginning the scanning process 

      2012-02-09 15:13:02,989 INFO  [org.jboss.solder.Version] (Thread-2) Solder 3.1.0.Final (build id: 3.1.0.Final)

      Feb 09, 2012 3:13:02 PM org.jboss.weld.environment.tomcat7.Tomcat7Container initialize

      INFO: Tomcat 7 detected, CDI injection will be available in Servlets and Filters. Injection into Listeners is not supported

      2012-02-09 15:13:03,064 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.persistence.util.EnvironmentUtils2 from being installed as bean due to @Veto annotation

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.transaction.DefaultSeamTransaction because of underlying class loading error

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: catching

      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.transaction.DefaultSeamTransaction

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)

          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:171)

          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)

          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)

          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

          at java.util.concurrent.FutureTask.run(FutureTask.java:166)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.NoClassDefFoundError: javax/ejb/EJBContext

          at java.lang.Class.getDeclaredMethods0(Native Method)

          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

          at java.lang.Class.getDeclaredMethods(Class.java:1808)

          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172)

          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:169)

          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.getDeclaredMethods(SecureReflections.java:169)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:233)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          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:149)

          ... 13 more

      Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBContext

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)

          ... 29 more

       

      2012-02-09 15:13:03,170 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.transaction.UTTransaction from being installed as bean due to @Veto annotation

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.transaction.CMTTransaction because of underlying class loading error

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: catching

      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.transaction.CMTTransaction

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)

          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:171)

          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)

          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)

          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

          at java.util.concurrent.FutureTask.run(FutureTask.java:166)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.NoClassDefFoundError: Ljavax/ejb/EJBContext;

          at java.lang.Class.getDeclaredFields0(Native Method)

          at java.lang.Class.privateGetDeclaredFields(Class.java:2308)

          at java.lang.Class.getDeclaredFields(Class.java:1760)

          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:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          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:149)

          ... 13 more

      Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBContext

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)

          ... 29 more

       

      2012-02-09 15:13:03,386 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Preventing installation of default bean: org.jboss.seam.transaction.EntityTransaction

      2012-02-09 15:13:03,386 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.transaction.EntityTransaction from being installed as bean due to @Veto annotation

      2012-02-09 15:13:03,567 INFO  [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (Thread-2) Preventing installation of default bean: org.jboss.seam.transaction.SeSynchronizations

      2012-02-09 15:13:03,568 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.transaction.SeSynchronizations from being installed as bean due to @Veto annotation

      2012-02-09 15:13:03,606 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.persistence.HibernatePersistenceProvider from being installed as bean due to @Veto annotation

      2012-02-09 15:13:03,630 INFO  [org.jboss.seam.persistence.ManagedPersistenceContextExtension] (Thread-2) Configuring Seam Managed Persistence Context from producer field org.jeffrey.EntityManagerProducer.emf with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]

      2012-02-09 15:13:03,754 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensionImpl from being installed as bean due to @Veto annotation

      2012-02-09 15:13:03,757 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.transaction.NoTransaction from being installed as bean due to @Veto annotation

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.persistence.util.EJBContextUtils because of underlying class loading error

      Feb 09, 2012 3:13:03 PM org.jboss.weld.bootstrap.BeanDeployer addClass

      INFO: catching

      org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.persistence.util.EJBContextUtils

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)

          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:171)

          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)

          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)

          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)

          at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

          at java.util.concurrent.FutureTask.run(FutureTask.java:166)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.NoClassDefFoundError: javax/ejb/EJBContext

          at java.lang.Class.getDeclaredMethods0(Native Method)

          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

          at java.lang.Class.getDeclaredMethods(Class.java:1808)

          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172)

          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:169)

          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.getDeclaredMethods(SecureReflections.java:169)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:233)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          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:149)

          ... 13 more

      Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBContext

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)

          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)

          ... 29 more

       

      2012-02-09 15:13:03,878 INFO  [org.jboss.solder.core.CoreExtension] (Thread-2) Preventing class org.jboss.seam.transaction.HibernateTransaction from being installed as bean due to @Veto annotation

      Feb 09, 2012 3:13:03 PM org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>

      WARNING: Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled

      Feb 09, 2012 3:13:03 PM org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>

      WARNING: Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled

      2012-02-09 15:13:04,004 INFO  [org.jboss.solder.exception.control.extension] (Thread-2) Adding handler Qualifiers: [@javax.enterprise.inject.Any()] TraversalMode: BREADTH_FIRST Handles Type: class java.lang.Throwable Precedence: -100 [method] public org.jboss.seam.transaction.SimpleTransactionExceptionHandler.markTransactionRollback(CaughtException<Throwable>) to known handlers

      2012-02-09 15:13:04,133 INFO  [org.jboss.solder.bean.defaultbean.DefaultBeanExtension] (Thread-2) Preventing install of default bean Managed Bean [class org.jboss.seam.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Synthetic]

      Feb 09, 2012 3:13:04 PM com.sun.faces.config.ConfigureListener contextInitialized

      INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/weld2'

      Feb 09, 2012 3:13:04 PM com.sun.faces.spi.InjectionProviderFactory createInstance

      INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.

      2012-02-09 15:13:04,965 INFO  [solder-servlet] (Thread-2) Catch Integration for Servlets enabled

      Feb 09, 2012 3:13:04 PM org.apache.coyote.AbstractProtocol start

      INFO: Starting ProtocolHandler ["http-bio-8080"]

      Feb 09, 2012 3:13:04 PM org.apache.coyote.AbstractProtocol start

      INFO: Starting ProtocolHandler ["ajp-bio-8009"]

      Feb 09, 2012 3:13:04 PM org.apache.catalina.startup.Catalina start

      INFO: Server startup in 6684 ms

       

       

       

      Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBContext

       

      It is a bug ?

        • 1. Re: Problem with seam-persistence  seam 3.1 tomcat 7
          bram meijboom Newbie

          nope,

           

          if you look at the log level you will see that it is an info level, in tomcat without a jta/ejb implementation you can use the (and the log tells you) the HibernateSessionTransaction and you probably have it configuered with the EntityTransaction in seam-beans.xml. It is just some information that some bindings are not available.

          eg

          INFO: WELD-000119 Not generating any bean definitions from org.jboss.seam.transaction.DefaultSeamTransaction because of underlying class loading error

           

          and after that comes the reason why the DefaultSeamTransaction is not loaded/bound

           

           

          If you add more seam modules that use different parts of the jee spec, but that are not incuded in the servlet spec the same thing happens, you will get stack traces informing you that a class is not found and one or more bindings are not installed.

           

          I have not tested if the stacktraces disapear if you include the ejb spec in a war though.

           

          grtz

          1 of 1 people found this helpful
          • 2. Re: Problem with seam-persistence  seam 3.1 tomcat 7
            Jeffrey Jia Newbie

            Hi bram

             

            When I add ejb-api-3.0.jar  the stacktrace disapear ,but  when I  call entityManager  em I get  error logs

             

             

            @Inject

            EntityManager em;

             

             

            public void action()

            {

            int n = em.createQuery("select a from Area a").getResultList().size();

             

            }

             

             

            ERROR LOGs :

             

            Feb 09, 2012 10:30:55 PM com.sun.faces.application.ActionListenerImpl processAction

            SEVERE: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

            javax.faces.el.EvaluationException: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)

                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:722)

            Caused by: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:111)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:45)

                at org.jboss.solder.bean.ImmutableBean.create(ImmutableBean.java:81)

                at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

                at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)

                at org.jboss.weld.proxies.EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.createQuery(EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.java)

                at org.jeffrey.UserAction.action2(UserAction.java:36)

                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.apache.el.parser.AstValue.invoke(AstValue.java:262)

                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

                at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)

                at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                ... 30 more

            Caused by: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:48)

                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

                at org.jboss.weldx.persistence.EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.createEntityManager(EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.java)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:95)

                ... 47 more

             

            Feb 09, 2012 10:30:55 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute

            WARNING: #{userAction.action2}: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

            javax.faces.FacesException: #{userAction.action2}: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)

                at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)

                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:722)

            Caused by: javax.faces.el.EvaluationException: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                ... 29 more

            Caused by: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:111)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:45)

                at org.jboss.solder.bean.ImmutableBean.create(ImmutableBean.java:81)

                at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

                at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)

                at org.jboss.weld.proxies.EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.createQuery(EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.java)

                at org.jeffrey.UserAction.action2(UserAction.java:36)

                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.apache.el.parser.AstValue.invoke(AstValue.java:262)

                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

                at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)

                at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                ... 30 more

            Caused by: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:48)

                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

                at org.jboss.weldx.persistence.EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.createEntityManager(EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.java)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:95)

                ... 47 more

             

            Feb 09, 2012 10:30:55 PM org.apache.catalina.core.StandardWrapperValve invoke

            SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/weld2] threw exception

            java.lang.RuntimeException: Exception invoking method [markTransactionRollback] on object [org.jboss.seam.transaction.SimpleTransactionExceptionHandler@40c5f303], using arguments [org.jboss.solder.exception.control.CaughtException@3d56b2e]

                at org.jboss.solder.reflection.Reflections.invokeMethod(Reflections.java:480)

                at org.jboss.solder.reflection.Reflections.invokeMethod(Reflections.java:403)

                at org.jboss.solder.reflection.annotated.InjectableMethod.invoke(InjectableMethod.java:175)

                at org.jboss.solder.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:182)

                at org.jboss.solder.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:92)

                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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)

                at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)

                at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)

                at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)

                at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)

                at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:559)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:554)

                at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:74)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:722)

            Caused by: java.lang.RuntimeException: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:111)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:45)

                at org.jboss.solder.bean.ImmutableBean.create(ImmutableBean.java:81)

                at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

                at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)

                at org.jboss.weld.proxies.EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.getTransaction(EntityManager$ManagedPersistenceContext$-403295909$Proxy$_$$_WeldClientProxy.java)

                at org.jboss.seam.transaction.EntityTransaction.getDelegate(EntityTransaction.java:59)

                at org.jboss.seam.transaction.EntityTransaction.getStatus(EntityTransaction.java:108)

                at org.jboss.seam.transaction.EntityTransaction$Proxy$_$$_WeldClientProxy.getStatus(EntityTransaction$Proxy$_$$_WeldClientProxy.java)

                at org.jboss.seam.transaction.SimpleTransactionExceptionHandler.markTransactionRollback(SimpleTransactionExceptionHandler.java:47)

                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.jboss.solder.reflection.Reflections.invokeMethod(Reflections.java:474)

                ... 41 more

            Caused by: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null

                at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:48)

                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)

                at org.jboss.weldx.persistence.EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.createEntityManager(EntityManagerFactory$-475986148$Proxy$_$$_Weld$Proxy$.java)

                at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:95)

                ... 56 more

             

             


            • 3. Re: Problem with seam-persistence  seam 3.1 tomcat 7
              Jeffrey Jia Newbie

              I have look at org.jboss.seam.persistence.ManagedPersistenceContextExtension.java

              Method :

               

              public <T> void processAnnotatedType(@Observes final ProcessAnnotatedType<T> event, BeanManager manager) {

               

               

              if (field.isAnnotationPresent(PersistenceUnit.class) && field.isAnnotationPresent(Produces.class) && !EnvironmentUtils.isEEEnvironment()) {

               

              ...}

               

              ...}

               

              When ejb-api-3.0.jar added , EnvironmentUtils.isEEEnvironment() will return true !