1 2 Previous Next 15 Replies Latest reply on Nov 10, 2011 9:08 AM by S. Holmslet

    How to configure Two JPA entity managers for RESORUCE_LOCAL?

    Gregory Nikle Apprentice

      Hi,
      Like in seam examples,my configuration works fine for JPA RESOURCE LOCAL on tomcat 6.
      How can I configure seam Two EM managers with JPA in components.xml


      This is my configuration of one EM


          <transaction:entity-transaction entity-manager="#{sguniAdm}" />                  
          <persistence:entity-manager-factory name="sguniAdmDatabase" persistence-unit-name="sguniAdmDatabase" />    
          <persistence:managed-persistence-context name="sguniAdm" auto-create="true" entity-manager-factory="#{sguniAdmDatabase}" />



      If I add another like this:



      <transaction:entity-transaction entity-manager="#{sguniOne}" />                  
          <persistence:entity-manager-factory name="sguniOneDatabase" persistence-unit-name="sguniOneDatabase" />    
          <persistence:managed-persistence-context name="sguniOne" auto-create="true" entity-manager-factory="#{sguniOneDatabase}" />



      I get following error:



      java.lang.RuntimeException: error while reading /WEB-INF/components.xml
           at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:154)
           at org.jboss.seam.init.Initialization.create(Initialization.java:104)
           at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
           at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
           at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
           at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
           at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
           at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
           at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
           at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
           at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
           at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
           at org.apache.catalina.core.StandardService.start(StandardService.java:516)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
           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:585)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: java.lang.IllegalStateException: Two components with the same name and precedence: org.jboss.seam.transaction.transaction
           at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:479)
           at org.jboss.seam.init.Initialization.installComponentFromXmlElement(Initialization.java:389)
           at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:280)
           at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:150)
           ... 26 more


        • 1. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
          Arbi Sookazian Master

          I modified the tomcatjpa that is one of the examples in the sfwk 2nd ed. by Yuan et al src download.


          Apr 5, 2009 8:48:06 AM org.jboss.seam.init.Initialization addComponentDescriptor
          INFO: two components with same name, higher precedence wins: org.jboss.seam.transaction.transaction
          Apr 5, 2009 8:48:06 AM org.apache.catalina.core.StandardContext start
          SEVERE: Error listenerStart
          Apr 5, 2009 8:48:06 AM org.apache.catalina.core.StandardContext start
          SEVERE: Context [/tomcatjpa] startup failed due to previous errors
          Apr 5, 2009 8:48:07 AM org.apache.coyote.http11.Http11Protocol start
          INFO: Starting Coyote HTTP/1.1 on http-8080
          Apr 5, 2009 8:48:07 AM org.apache.jk.common.ChannelSocket init
          INFO: JK: ajp13 listening on /0.0.0.0:8009
          Apr 5, 2009 8:48:07 AM org.apache.jk.server.JkMain start
          INFO: Jk running ID=0 time=0/129  config=null
          Apr 5, 2009 8:48:07 AM org.apache.catalina.startup.Catalina start
          INFO: Server startup in 4807 ms
          



          based on these files:


          persistence.xml:


          <persistence>
             <persistence-unit name="helloworld1" transaction-type="RESOURCE_LOCAL">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <non-jta-data-source>java:comp/env/jdbc/TestDB</non-jta-data-source>
                <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
                   <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                   <property name="hibernate.show_sql" value="true"/>
                   
                   <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
                </properties>
             </persistence-unit>
             
             <persistence-unit name="helloworld2" transaction-type="RESOURCE_LOCAL">
                   <provider>org.hibernate.ejb.HibernatePersistence</provider>
                   <non-jta-data-source>java:comp/env/jdbc/TestDB</non-jta-data-source>
                   <properties>
                      <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
                      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                      <property name="hibernate.show_sql" value="true"/>
                      
                      <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
                   </properties>
             </persistence-unit>
          </persistence>



          components.xml:


          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
                      xmlns:core="http://jboss.com/products/seam/core"
                      xmlns:persistence="http://jboss.com/products/seam/persistence"
                      xmlns:transaction="http://jboss.com/products/seam/transaction"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation=
                        "http://jboss.com/products/seam/core 
                         http://jboss.com/products/seam/core-2.0.xsd
                         http://jboss.com/products/seam/transaction 
                         http://jboss.com/products/seam/transaction-2.0.xsd
                         http://jboss.com/products/seam/persistence 
                         http://jboss.com/products/seam/persistence-2.0.xsd">
          
            <core:init debug="true"/>
          
            <core:manager conversation-timeout="120000"/>
            
            <!-- *********************************************************************** -->
          
            <transaction:entity-transaction entity-manager="#{em1}"/>
          
            <persistence:entity-manager-factory name="helloworld1"/>
          
            <persistence:managed-persistence-context name="em1"
                    auto-create="true" entity-manager-factory="#{helloworld1}"/>
                    
            <!-- *********************************************************************** -->
                    
            <transaction:entity-transaction entity-manager="#{em2}"/>
                 
            <persistence:entity-manager-factory name="helloworld2"/>
                 
            <persistence:managed-persistence-context name="em2"
                    auto-create="true" entity-manager-factory="#{helloworld2}"/>
          
          </components>
          



          with Seam 2.1.0.SP1 and Tomcat 6

          • 2. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
            Stuart Douglas Master

            Try giving each entity-transaction a different name.

            • 3. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
              Gregory Nikle Apprentice

              I fixed it myself by adding precedence


              this is working example:



                  <transaction:entity-transaction entity-manager="#{sguniAdm}" precedence="1" />                  
                  <persistence:entity-manager-factory name="sguniAdmDatabase" />
                  <persistence:managed-persistence-context name="sguniAdm" auto-create="true" entity-manager-factory="#{sguniAdmDatabase}"/>   
              
                  <transaction:entity-transaction entity-manager="#{sguniOne}" precedence="2" />                  
                  <persistence:entity-manager-factory name="sguniOneDatabase" />
                  <persistence:managed-persistence-context name="sguniOne" auto-create="true" entity-manager-factory="#{sguniOneDatabase}"/> 


              • 4. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                Stuart Douglas Master

                The precidence means that only one will actually be installed. This is probably not what you want.

                • 5. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                  Gregory Nikle Apprentice

                  oh, I thought that means which should be installed first at startup.


                  hmmm, but they works fine, each one for each db but in diffrerence transactions.


                  So why they work? ;)
                  what you mean installed? other one is sleeped/disabled?

                  • 6. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                    Stuart Douglas Master

                    In the log there should be some text like


                    INFO: two components with same name, higher precedence wins: org.jboss.seam.transaction.transaction
                    



                    To be honest I am not totally sure what the result of this will be, I would have to look though the sources.

                    • 7. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                      Gregory Nikle Apprentice

                      You're wrong Stuart.
                      Yesterday I've tryed to check your solution with name and When I remove precedence and add name xx I get same error, when I add precedence without name it work.

                      • 8. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                        Arbi Sookazian Master

                        most likely Stuart was correct as per this in the Seam ref docs:



                        @Install works by letting you specify precedence and dependencies.
                        The precedence of a component is a number that Seam uses to decide which component to
                        install when there are multiple classes with the same component name in the classpath. Seam
                        will choose the component with the higher precendence.

                        What this may mean, based on the behavior you're seeing, is that there may be some bug in your version of Seam.


                        that's my guess...


                        the question is which classes in your situation have the same component name???  in other words, why is precedence even an issue for you???

                        • 9. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                          Gregory Nikle Apprentice

                          Here is my Components.xml



                          <?xml version="1.0" encoding="UTF-8"?>
                          <components xmlns="http://jboss.com/products/seam/components"
                                      xmlns:core="http://jboss.com/products/seam/core"
                                      xmlns:async="http://jboss.com/products/seam/async"
                                      xmlns:persistence="http://jboss.com/products/seam/persistence"
                                      xmlns:security="http://jboss.com/products/seam/security"
                                      xmlns:drools="http://jboss.com/products/seam/drools"            
                                      xmlns:transaction="http://jboss.com/products/seam/transaction"
                                      xmlns:theme="http://jboss.com/products/seam/theme"
                                      xmlns:web="http://jboss.com/products/seam/web"
                                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                      xsi:schemaLocation=
                                          "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                                           http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
                                           http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
                                           http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                                           http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                                           http://jboss.com/products/seam/theme http://jboss.com/products/seam/theme-2.0.xsd
                                           http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
                                           http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd                 
                                           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
                          
                              <!-- <core:init jndi-pattern="@jndiPattern@" debug="false"/>-->
                              <core:init jndi-pattern="sguni/#{ejbName}/local" debug="false"/>
                           
                              <core:manager conversation-timeout="60000"
                                            concurrent-request-timeout="500"
                                            conversation-id-parameter="cid"/>          
                              
                              <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true" />
                              <drools:rule-base name="securityRules">
                                  <drools:rule-files><value>/META-INF/security-rules.drl</value></drools:rule-files>
                              </drools:rule-base>    
                              
                              <web:multipart-filter create-temp-files="true" 
                                                    max-request-size="1000000" 
                                                    url-pattern="*.seam"/>
                           
                              <transaction:entity-transaction name="test1" entity-manager="#{sguniAdm}" />                  
                              <persistence:entity-manager-factory name="sguniAdmDatabase" />
                              <persistence:managed-persistence-context name="sguniAdm" auto-create="true" entity-manager-factory="#{sguniAdmDatabase}"/>   
                          
                              <transaction:entity-transaction name="test2" entity-manager="#{sguniOne}"/>                  
                              <persistence:entity-manager-factory name="sguniOneDatabase" />
                              <persistence:managed-persistence-context name="sguniOne" auto-create="true" entity-manager-factory="#{sguniOneDatabase}"/>   
                          
                              <component name="org.jboss.seam.remoting.remoting">
                                <property name="debug">false</property>
                              </component>    
                                  
                              <factory name="remoteAddr" value="#{facesContext.externalContext.request.remoteAddr}"/>   
                               <theme:theme-selector cookie-enabled="true" />          
                                  <async:quartz-dispatcher/>    
                          </components>


                          • 10. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                            Jeff Newbie

                            How would you inject those EntityManagers? When I followed your example and injected @In EntityManager sguniAdm, I got this error:



                            org.jboss.seam.jsf.SeamPhaseListener afterPhase
                            SEVERE: swallowing exception
                            java.lang.IllegalStateException: Could not commit transaction
                                    at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:626)
                                    at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:605)
                                    at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:343)
                                    at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
                                    at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                                    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                                    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                                    at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                                    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                                    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                                    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                                    at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                    at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
                                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                                    at java.lang.Thread.run(Thread.java:619)
                            Caused by: java.lang.RuntimeException: exception invoking: getTransaction
                                    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)
                                    at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                                    at org.jboss.seam.Component.unwrap(Component.java:2237)
                                    at org.jboss.seam.Component.getInstance(Component.java:2004)
                                    at org.jboss.seam.Component.getInstance(Component.java:1967)
                                    at org.jboss.seam.Component.getInstance(Component.java:1961)
                                    at org.jboss.seam.Component.getInstance(Component.java:1934)
                                    at org.jboss.seam.Component.getInstance(Component.java:1929)
                                    at org.jboss.seam.transaction.Transaction.instance(Transaction.java:36)
                                    at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:611)
                                    ... 37 more
                            Caused by: javax.naming.NamingException: Cannot create resource instance
                                    at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)
                                    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
                                    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
                                    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
                                    at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
                                    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
                                    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
                                    at javax.naming.InitialContext.lookup(InitialContext.java:392)
                                    at org.jboss.seam.transaction.Transaction.getUserTransaction(Transaction.java:79)
                                    at org.jboss.seam.transaction.Transaction.createUTTransaction(Transaction.java:71)
                                    at org.jboss.seam.transaction.Transaction.getTransaction(Transaction.java:44)
                                    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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                                    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                            



                            • 11. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                              Felipe Jaekel Newbie

                              Jeff Ning wrote on May 27, 2009 21:16:


                              How would you inject those EntityManagers? When I followed your example and injected @In EntityManager sguniAdm, I got this error:


                              org.jboss.seam.jsf.SeamPhaseListener afterPhase
                              SEVERE: swallowing exception
                              java.lang.IllegalStateException: Could not commit transaction
                                      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:626)
                                      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:605)
                                      at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:343)
                                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
                                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
                                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                                      at java.lang.Thread.run(Thread.java:619)
                              Caused by: java.lang.RuntimeException: exception invoking: getTransaction
                                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)
                                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                                      at org.jboss.seam.Component.unwrap(Component.java:2237)
                                      at org.jboss.seam.Component.getInstance(Component.java:2004)
                                      at org.jboss.seam.Component.getInstance(Component.java:1967)
                                      at org.jboss.seam.Component.getInstance(Component.java:1961)
                                      at org.jboss.seam.Component.getInstance(Component.java:1934)
                                      at org.jboss.seam.Component.getInstance(Component.java:1929)
                                      at org.jboss.seam.transaction.Transaction.instance(Transaction.java:36)
                                      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:611)
                                      ... 37 more
                              Caused by: javax.naming.NamingException: Cannot create resource instance
                                      at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:113)
                                      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
                                      at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
                                      at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
                                      at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
                                      at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
                                      at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
                                      at javax.naming.InitialContext.lookup(InitialContext.java:392)
                                      at org.jboss.seam.transaction.Transaction.getUserTransaction(Transaction.java:79)
                                      at org.jboss.seam.transaction.Transaction.createUTTransaction(Transaction.java:71)
                                      at org.jboss.seam.transaction.Transaction.getTransaction(Transaction.java:44)
                                      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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                              






                              Same thing here, please help.


                              Thanks,
                              Felipe

                              • 13. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                                Andrey Chorniy Newbie

                                Huh, it is about 8 months the issue exists and there is no any feedback on that... Is it even going to be fixed ?

                                • 14. Re: How to configure Two JPA entity managers for RESORUCE_LOCAL?
                                  Stuart Douglas Master

                                  If you only set the name on one (but not both) entity-transaction it should work.


                                  Seam managed transactions will only be active for the entity-transaction that does not have a name.

                                  1 2 Previous Next