Problems with Transaction after moving from Seam 2.0 to Seam 2.2
ibenjes Oct 8, 2010 9:22 AMHi,
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&characterEncoding=utf8&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?