4 Replies Latest reply on Oct 8, 2010 10:53 AM by Immo Benjes

    Problems with Transaction after moving from Seam 2.0 to Seam 2.2

    Immo Benjes Newbie

      Hi,


      I've inherited a Seam 2.0 project running on JBoss 4.2.2 which I am currently trying to migrate to Seam 2.2.1 and JBoss 5.1.


      I followed the migration guide and other resources I could find regarding migration but now I am running into a problem with Transactions not being active.




      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:dedb:4caf0d6a:79 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:dedb:4caf0d6a:79 status: ActionStatus.ABORT_ONLY >)
              at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:110)
              at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:43)
              at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
              ... 173 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:dedb:4caf0d6a:79 status: ActionStatus.ABORT_ONLY >
              at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
              at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
              at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:104)
              ... 175 more
      13:26:41,258 SEVERE [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /secure/home.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1ecbec08]



      The project is using POJOs in a JEE environment so I was expecting that it is using JTA transactions and would behave similar to EJB3 beans (a transaction is available and started when a method is being called). This certainly did work with Seam 2.0 and JBoss 4.2.2.


      This is my deployment descriptor:



      <datasources>
      
         <local-tx-datasource>
             <jndi-name>Odyssey0.5.0Datasource</jndi-name>
              <use-java-context>false</use-java-context>
             <connection-url>jdbc:mysql://localhost:8889/mydb?useUnicode=true&amp;characterEncoding=utf8&amp;charactetrResultSets=utf8</connection-url>
             <driver-class>com.mysql.jdbc.Driver</driver-class>
             <user-name>XXX</user-name>
             <password>XXX</password>
         </local-tx-datasource>
      
      </datasources>



      This is the component.xml



      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:async="http://jboss.com/products/seam/async"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:drools="http://jboss.com/products/seam/drools"
       xmlns:mail="http://jboss.com/products/seam/mail"
       xmlns:persistence="http://jboss.com/products/seam/persistence"
       xmlns:security="http://jboss.com/products/seam/security"
       xmlns:transaction="http://jboss.com/products/seam/transaction"
       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.2.xsd    http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd    http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd    http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd                    http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.2.xsd                    http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd                    http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd                      http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd                      http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
       <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
       <core:manager concurrent-request-timeout="10000"
        conversation-id-parameter="cid" conversation-timeout="120000"/>
       <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
       <web:hot-deploy-filter url-pattern="*.seam"/>
       <persistence:managed-persistence-context auto-create="true"
        name="entityManager" persistence-unit-jndi-name="@puJndiName@"/>
       <transaction:ejb-transaction/>
       <!--  Timer service -->
       <async:quartz-dispatcher/>
       <!--  Rules Declarations -->
       <drools:rule-base auto-create="true" name="financeValidationRules" scope="application">
        <drools:rule-files>
         <value>/FinanceValidation.drl</value>
        </drools:rule-files>
       </drools:rule-base>
       <security:rule-based-permission-resolver security-rules="#{financeValidationRules}"/>
       <security:identity authenticate-method="#{authenticator.authenticate}"/>
      ... 
      </components>
      


      And the web.xml



      <?xml version="1.0" ?>
      
      <web-app version="2.5"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
           <!-- Ajax4jsf -->
      
           <context-param>
                <param-name>org.ajax4jsf.VIEW_HANDLERS
                </param-name>
                <param-value>com.sun.facelets.FaceletViewHandler
                </param-value>
           </context-param>
           
           
           <!--  RichFaces -->
           
            <!-- Suppress spurious stylesheets -->
      
         <context-param>
            <param-name>org.richfaces.CONTROL_SKINNING</param-name>
            <param-value>disable</param-value>
         </context-param>
      
         <context-param>
            <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
            <param-value>disable</param-value>
         </context-param>
      
         <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
      
         <context-param>
            <param-name>org.richfaces.LoadStyleStrategy</param-name>
            <param-value>ALL</param-value>
         </context-param>
      
         <context-param>
            <param-name>org.richfaces.LoadScriptStrategy</param-name>
            <param-value>ALL</param-value>
         </context-param>
      
           <!--
                <context-param> <param-name>org.ajax4jsf.SKIN</param-name>
                <param-value>classic</param-value> </context-param>
           -->
      
           <!-- Seam -->
           
      
      
           <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener
                </listener-class>
           </listener>
      
           <listener>
                <listener-class>com.locuslive.odyssey.session.conversation.SessionAction
                </listener-class>
           </listener>
      
           <filter>
                <filter-name>Performance Reporting Filter</filter-name>
                <filter-class>
                     com.locuslive.odyssey.performance.PerformanceReportingFilter
                </filter-class>
           </filter>
      
           <filter>
                <filter-name>UTF8 Filter</filter-name>
                <filter-class>com.locuslive.odyssey.filter.UTF8Filter
                </filter-class>
           </filter>
           <filter-mapping>
                <filter-name>UTF8 Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>
      
           <filter>
                <filter-name>Seam Filter</filter-name>
                <filter-class>org.jboss.seam.servlet.SeamFilter
                </filter-class>
           </filter>
      
      
           <filter-mapping>
                <filter-name>Performance Reporting Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>
      
           <filter-mapping>
                <filter-name>Seam Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>
      
           <filter>
                <filter-name>CacheControlFilter</filter-name>
                <filter-class>com.locuslive.odyssey.filter.CacheControlFilter</filter-class>
           </filter>
      
           <filter-mapping>
                <filter-name>CacheControlFilter</filter-name>
                <url-pattern>*.png</url-pattern>
           </filter-mapping>
           <filter-mapping>
                <filter-name>CacheControlFilter</filter-name>
                <url-pattern>*.css</url-pattern>
           </filter-mapping>
           <filter-mapping>
                <filter-name>CacheControlFilter</filter-name>
                <url-pattern>*.js</url-pattern>
           </filter-mapping>
           <filter-mapping>
                <filter-name>CacheControlFilter</filter-name>
                <url-pattern>*.gif</url-pattern>
           </filter-mapping>
           <filter-mapping>
                <filter-name>CacheControlFilter</filter-name>
                <url-pattern>*.jpg</url-pattern>
           </filter-mapping>
      
           <!--
                MessAdmin Resource profiling <filter>
                <filter-name>MessAdminFilter</filter-name>
                <filter-class>clime.messadmin.filter.MessAdminFilter</filter-class>
                </filter> <filter-mapping> <filter-name>MessAdminFilter</filter-name>
                <url-pattern>/*</url-pattern> </filter-mapping> <listener>
                <listener-class>clime.messadmin.core.MessAdminListener</listener-class>
                </listener>
           -->
           <servlet>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet
                </servlet-class>
           </servlet>
      
           <servlet-mapping>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
      
           <!-- Facelets development mode (disable in production) -->
      
           <context-param>
                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>false</param-value>
           </context-param>
      
           <!-- JSF -->
      
           <context-param>
                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                <param-value>server</param-value>
           </context-param>
      
           <context-param>
                <param-name>com.sun.faces.serializeViewState</param-name>
                <param-value>true</param-value>
           </context-param>
      
           <context-param>
                <param-name>com.sun.faces.compressViewState</param-name>
                <param-value>true</param-value>
           </context-param>
      
           <context-param>
                <param-name>facelets.SKIP_COMMENTS</param-name>
                <param-value>false</param-value>
           </context-param>
      
           <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX
                </param-name>
                <param-value>.xhtml</param-value>
           </context-param>
      
           <context-param>
               <param-name>org.ajax4jsf.DEFAULT_EXPIRE</param-name>
               <param-value>2592000</param-value>
           </context-param>
      
           <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>
      
           <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.seam</url-pattern>
           </servlet-mapping>
      
           <servlet>
                <servlet-name>Document Store Servlet</servlet-name>
                <servlet-class>com.locuslive.odyssey.documents.servlet.DocServlet
                </servlet-class>
                <load-on-startup>2</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Document Store Servlet</servlet-name>
                <url-pattern>/documents/file/*</url-pattern>
           </servlet-mapping>
      
           <servlet>
                <servlet-name>Document Image Servlet</servlet-name>
                <servlet-class>com.locuslive.odyssey.documents.servlet.ImageServlet
                </servlet-class>
                <load-on-startup>2</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Document Image Servlet</servlet-name>
                <url-pattern>/documents/image/*</url-pattern>
           </servlet-mapping>
      
           <servlet>
                <servlet-name>Document Store Tree Servlet</servlet-name>
                <servlet-class>
                     com.locuslive.odyssey.documents.servlet.DocStoreTreeServlet
                </servlet-class>
                <load-on-startup>2</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Document Store Tree Servlet</servlet-name>
                <url-pattern>/documents/tree</url-pattern>
           </servlet-mapping>
      
           <security-constraint>
                <display-name>Restrict raw XHTML Documents</display-name>
                <web-resource-collection>
                     <web-resource-name>XHTML</web-resource-name>
                     <url-pattern>*.xhtml</url-pattern>
                </web-resource-collection>
                <auth-constraint />
           </security-constraint>
      
           <error-page>
                <exception-type>java.lang.Exception
                </exception-type>
                <location>/error.xhtml</location>
           </error-page>
      
           <session-config>
                <session-timeout>60</session-timeout>
           </session-config>
      
      
        <persistence-unit-ref>
            <persistence-unit-ref-name>Odyssey0.5.0/pu</persistence-unit-ref-name>
            <persistence-unit-name>Odyssey0.5.0</persistence-unit-name>
         </persistence-unit-ref>
        
      
      
      </web-app>



      Start up log:



      13:57:15,110 INFO  [JBossASKernel] Created KernelDeployment for: jboss-seam.jar
      13:57:15,110 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3
      13:57:15,110 INFO  [JBossASKernel]   with dependencies:
      13:57:15,110 INFO  [JBossASKernel]   and demands:
      13:57:15,110 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService
      13:57:15,110 INFO  [JBossASKernel]   and supplies:
      13:57:15,110 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/TimerServiceDispatcher/local-org.jboss.seam.async.LocalTimerServiceDispatcher
      13:57:15,111 INFO  [JBossASKernel]      Class:org.jboss.seam.async.LocalTimerServiceDispatcher
      13:57:15,111 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/TimerServiceDispatcher/remote
      13:57:15,111 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/TimerServiceDispatcher/local
      13:57:15,111 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3) to KernelDeployment of: jboss-seam.jar
      13:57:15,111 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3
      13:57:15,111 INFO  [JBossASKernel]   with dependencies:
      13:57:15,111 INFO  [JBossASKernel]   and demands:
      13:57:15,112 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService
      13:57:15,112 INFO  [JBossASKernel]   and supplies:
      13:57:15,112 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/EjbSynchronizations/remote
      13:57:15,112 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/EjbSynchronizations/local-org.jboss.seam.transaction.LocalEjbSynchronizations
      13:57:15,112 INFO  [JBossASKernel]      Class:org.jboss.seam.transaction.LocalEjbSynchronizations
      13:57:15,112 INFO  [JBossASKernel]      jndi:Odyssey0.5.0/EjbSynchronizations/local
      13:57:15,112 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3) to KernelDeployment of: jboss-seam.jar
      13:57:15,147 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@3ea621a{name=jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
      13:57:15,147 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@6c201866{name=jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
      13:57:15,206 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=Odyssey0.5.0.ear/Odyssey0.5.0.jar#Odyssey0.5.0
      13:57:15,289 INFO  [Version] Hibernate Annotations 3.4.0.GA
      13:57:15,318 INFO  [Environment] Hibernate 3.3.1.GA
      13:57:15,325 INFO  [Environment] hibernate.properties not found
      13:57:15,337 INFO  [Environment] Bytecode provider name : javassist
      13:57:15,347 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
      13:57:15,471 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
      13:57:15,477 INFO  [Version] Hibernate EntityManager 3.4.0.GA
      13:57:15,521 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
              name: Odyssey0.5.0
              ...]
      13:57:15,799 WARN  [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      ...
      13:57:17,505 INFO  [Version] Hibernate Validator 3.1.0.GA
      13:57:18,048 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
      13:57:18,449 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      13:57:18,454 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
      13:57:18,689 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.1.37-log
      13:57:18,689 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.12 ( Revision: ${bzr.revision-id} )
      13:57:18,720 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
      13:57:18,728 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
      13:57:18,734 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
      13:57:18,737 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      13:57:18,737 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
      13:57:18,737 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
      13:57:18,738 INFO  [SettingsFactory] JDBC batch size: 15
      13:57:18,738 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
      13:57:18,739 INFO  [SettingsFactory] Scrollable result sets: enabled
      13:57:18,739 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
      13:57:18,739 INFO  [SettingsFactory] Connection release mode: auto
      13:57:18,740 INFO  [SettingsFactory] Maximum outer join fetch depth: 2
      13:57:18,740 INFO  [SettingsFactory] Default batch fetch size: 1
      13:57:18,741 INFO  [SettingsFactory] Generate SQL with comments: enabled
      13:57:18,741 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
      13:57:18,741 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
      13:57:18,741 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      13:57:18,760 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      13:57:18,760 INFO  [SettingsFactory] Query language substitutions: {}
      13:57:18,760 INFO  [SettingsFactory] JPA-QL strict compliance: disabled
      13:57:18,760 INFO  [SettingsFactory] Second-level cache: enabled
      13:57:18,760 INFO  [SettingsFactory] Query cache: enabled
      13:57:18,760 INFO  [SettingsFactory] Cache region factory : net.sf.ehcache.hibernate.EhCacheRegionFactory
      13:57:18,811 INFO  [SettingsFactory] Optimize cache for minimal puts: enabled
      13:57:18,812 INFO  [SettingsFactory] Cache region prefix: Odyssey
      13:57:18,812 INFO  [SettingsFactory] Structured second-level cache entries: disabled
      13:57:18,812 INFO  [SettingsFactory] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
      13:57:18,823 INFO  [SettingsFactory] Echoing all SQL to stdout
      13:57:18,824 INFO  [SettingsFactory] Statistics: disabled
      13:57:18,824 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      13:57:18,824 INFO  [SettingsFactory] Default entity-mode: pojo
      13:57:18,824 INFO  [SettingsFactory] Named query checking : enabled
      13:57:19,003 INFO  [SessionFactoryImpl] building session factory
      13:57:19,934 WARN  [EhcacheEntityRegion] read-only cache configured for mutable entity [Odyssey.cache.CountryCode]
      13:57:20,299 WARN  [EhcacheEntityRegion] read-only cache configured for mutable entity [Odyssey.cache.UnLocode]
      13:57:21,158 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=Odyssey0.5.0.ear/Odyssey0.5.0.jar#Odyssey0.5.0
      13:57:21,162 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      13:57:21,169 INFO  [NamingHelper] Creating subcontext: persistence.unit:unitName=Odyssey0.5.0.ear
      13:57:21,169 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=Odyssey0.5.0.ear/Odyssey0.5.0.jar#Odyssey0.5.0
      13:57:21,169 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext
      13:57:21,170 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      13:57:21,184 INFO  [UpdateTimestampsCache] starting update timestamps cache at region: Odyssey.org.hibernate.cache.UpdateTimestampsCache
      13:57:21,190 INFO  [StandardQueryCache] starting query cache at region: Odyssey.org.hibernate.cache.StandardQueryCache
      13:57:21,590 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3
      13:57:21,590 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.async.TimerServiceDispatcher ejbName: TimerServiceDispatcher
      13:57:21,609 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
              Odyssey0.5.0/TimerServiceDispatcher/local - EJB3.x Default Local Business Interface
              Odyssey0.5.0/TimerServiceDispatcher/local-org.jboss.seam.async.LocalTimerServiceDispatcher - EJB3.x Local Business Interface
      
      13:57:21,690 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=Odyssey0.5.0.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3
      13:57:21,691 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.transaction.EjbSynchronizations ejbName: EjbSynchronizations
      13:57:21,707 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
              Odyssey0.5.0/EjbSynchronizations/local - EJB3.x Default Local Business Interface
              Odyssey0.5.0/EjbSynchronizations/local-org.jboss.seam.transaction.LocalEjbSynchronizations - EJB3.x Local Business Interface
      
      13:57:21,789 INFO  [TomcatDeployment] deploy, ctxPath=/Odyssey
      13:57:21,892 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/Odyssey'
      13:57:23,063 INFO  [ServletContextListener] Welcome to Seam 2.2.0.GA
      #Comment some SQL queries here
      13:57:31,767 WARN  [PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
      13:57:32,028 INFO  [TestApplicationBean] Test Application Bean has started
      13:57:32,042 WARN  [QuartzDispatcher] No seam.quartz.properties file. Using in-memory job store.
      13:57:32,075 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
      13:57:32,158 INFO  [QuartzScheduler] Quartz Scheduler v.1.6.0 created.
      13:57:32,160 INFO  [RAMJobStore] RAMJobStore initialized.
      13:57:32,160 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
      13:57:32,160 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.6.0
      13:57:32,160 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
      13:57:32,236 INFO  [CommoditySections] Creating APPLICATION scoped CommoditySection Bean
      13:57:32,236 INFO  [CommodityChapters] Creating APPLICATION scoped CommodityChapter Bean
      13:57:32,437 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      13:57:32,475 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      13:57:32,482 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:16s:58ms
      



      The above exception with transaction not being active is thrown when I try to log into the system. It issues a few SQL queries successfully (so transactions are started for these POJOs) but then eventually I get the transaction not active exception.


      At first I got the exception in a Seam PoJo which used a hibernate session.
      After annotating the component with @Transactional it worked.
      This time it crashed on a PoJo which used a normal JPA entity manager. I've tried to annotate it with @Transaction as well but that didn't solve the problem.


      I thought I shouldn't need @Transactional with Seam using JTA and specifying




      <transaction:ejb-transaction/>





      . Is that correct?
      I guess something is wrong with the configuration, any idea what it could be?



        • 1. Re: Problems with Transaction after moving from Seam 2.0 to Seam 2.2
          Immo Benjes Newbie

          One more thing.
          The Hibernate Session and the JPA entity manager are both injected using the normal Seam approach


          @In EntityManager entityManager;


          and
          @In Session hibernateSession;

          • 2. Re: Problems with Transaction after moving from Seam 2.0 to Seam 2.2
            Immo Benjes Newbie

            Here is the complete stack trace.



            2010-10-08 14:17:33,417 SEVERE [facelets.viewhandler] (http-127.0.0.1-8080-1) Error Rendering View[/secure/home.xhtml]
            org.jboss.seam.InstantiationException: Could not instantiate Seam component: taskList
                 at org.jboss.seam.Component.newInstance(Component.java:2144)
                 at org.jboss.seam.Component.getInstance(Component.java:2021)
                 at org.jboss.seam.Component.getInstance(Component.java:1983)
                 at org.jboss.seam.Component.getInstance(Component.java:1977)
                 at org.jboss.seam.Component.getInstanceFromFactory(Component.java:2073)
                 at org.jboss.seam.Component.getInstance(Component.java:2011)
                 at org.jboss.seam.Component.getInstance(Component.java:1983)
                 at org.jboss.seam.Component.getInstance(Component.java:1977)
                 at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
                 at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
                 at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
                 at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
                 at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
                 at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
                 at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
                 at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
                 at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                 at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                 at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:924)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
                 at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239)
                 at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180)
                 at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
                 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                 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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                 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:368)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
                 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.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                 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 com.locuslive.odyssey.performance.PerformanceReportingFilter.doFilter(PerformanceReportingFilter.java:28)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at com.locuslive.odyssey.filter.UTF8Filter.doFilter(UTF8Filter.java:21)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 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:235)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Thread.java:637)
            Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
                 at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
                 at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
                 at com.locuslive.odyssey.session.user.UserAction.getUsersByCompany(UserAction.java:309)
                 at com.locuslive.odyssey.session.user.UserAction.getUsersSelectItemGroupForCompany(UserAction.java:285)
                 at com.locuslive.odyssey.session.user.UserAction.getUserSelectListByCompany(UserAction.java:265)
                 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.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
                 at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
                 at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at com.locuslive.odyssey.performance.TimingInterceptor.timeCall(TimingInterceptor.java:48)
                 at sun.reflect.GeneratedMethodAccessor352.invoke(Unknown Source)
                 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.intercept.Interceptor.aroundInvoke(Interceptor.java:187)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72)
                 at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                 at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                 at com.locuslive.odyssey.session.user.UserAction_$$_javassist_seam_18.getUserSelectListByCompany(UserAction_$$_javassist_seam_18.java)
                 at com.locuslive.odyssey.session.task.TaskList.loadUsersForCompany(TaskList.java:288)
                 at com.locuslive.odyssey.session.task.TaskList.init(TaskList.java:95)
                 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.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                 at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at com.locuslive.odyssey.performance.TimingInterceptor.timeCall(TimingInterceptor.java:48)
                 at sun.reflect.GeneratedMethodAccessor352.invoke(Unknown Source)
                 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.intercept.Interceptor.aroundInvoke(Interceptor.java:187)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72)
                 at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                 at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
                 at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                 at com.locuslive.odyssey.session.task.TaskList_$$_javassist_seam_23.init(TaskList_$$_javassist_seam_23.java)
                 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)
                 at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
                 at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
                 at org.jboss.seam.Component.newInstance(Component.java:2132)
                 ... 87 more
            Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
                 at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
                 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
                 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
                 at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
                 at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
                 at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
                 at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
                 at org.hibernate.loader.Loader.doQuery(Loader.java:696)
                 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
                 at org.hibernate.loader.Loader.doList(Loader.java:2228)
                 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
                 at org.hibernate.loader.Loader.list(Loader.java:2120)
                 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
                 at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
                 at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
                 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
                 at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
                 at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
                 ... 155 more
            Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:e16e:4caf19b3:75 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:e16e:4caf19b3:75 status: ActionStatus.ABORT_ONLY >)
                 at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:110)
                 at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:43)
                 at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                 ... 169 more
            Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a00005e:e16e:4caf19b3:75 status: ActionStatus.ABORT_ONLY >
                 at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
                 at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
                 at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
                 at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:104)
                 ... 171 more



            It seems Seam wants to enrol it in a transaction




            at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
                 at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
                 at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)



            Any help would really be appreaciated.



            • 3. Re: Problems with Transaction after moving from Seam 2.0 to Seam 2.2
              Immo Benjes Newbie

              Okay this seems to take a different turn now.
              I added some exception handling to get to the root and it seems the problem is that
              my hibernate session can't be injected:




              org.jboss.seam.RequiredException: @In attribute requires non-null value: taskList.hibernateSession
                      at org.jboss.seam.Component.getValueToInject(Component.java:2335)
                      at org.jboss.seam.Component.injectAttributes(Component.java:1736)
                      at org.jboss.seam.Component.inject(Component.java:1554)
                      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
                      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)




              I read in the migration document that the default name for the hibernate session changed from session to hibernateSession so I changed the code from




              @In 
              private Session session;




              to



              @In(value="hibernateSession")
              private Session session;





              I also tried



              @In
              private Session hibernateSession; 




              but that didn't work either.


              In the orginal component.xml file for Seam 2.0 I found this line:



              <factory auto-create="true" name="session" scope="STATELESS" value="#{entityManager.delegate}"/>



              I took it out as I thought this shouldn't be needed with Seam 2.2


              What do I have to do to get my hibernate injection to work?

              • 4. Re: Problems with Transaction after moving from Seam 2.0 to Seam 2.2
                Immo Benjes Newbie

                Okay fixed. If you use both EntityManager and Hibernate Session you need to use the factory above.
                Well at least I've learned a bit more about the configuration now :-)