[jboss-jira] [JBoss JIRA] (WFLY-2960) UserTransaction not found - JTA

ofbiz brazil (JIRA) issues at jboss.org
Tue Feb 18 16:25:47 EST 2014


ofbiz brazil created WFLY-2960:
----------------------------------

             Summary: UserTransaction not found - JTA
                 Key: WFLY-2960
                 URL: https://issues.jboss.org/browse/WFLY-2960
             Project: WildFly
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: JPA / Hibernate
    Affects Versions: 8.0.0.Final
         Environment: Spring 4.0.1, Hibernate 4.3.1, EJB
            Reporter: ofbiz brazil
            Assignee: Scott Marlow
            Priority: Critical


1) There's no UserTransaction implemented by WildFly.
JNDI tree view shows:

=== WildFly 8.0.0Final ===
 "java:jboss" => {
     "UserTransaction" => {
         "class-name" => "javax.transaction.UserTransaction",
         "value" => "UserTransaction"
     },			 

=== JBoss 7.1.1 ===
         "java:jboss" => {
             "UserTransaction" => {
                 "class-name" => "org.jboss.tm.usertx.client.ServerVMClientUserTransaction",
                 "value" => "org.jboss.tm.usertx.client.ServerVMClientUserTransaction at 9e85f"
             },

2) Method locateUserTransaction in JBossAppServerJtaPlatform can't get transaction objet from JNDI tree.

3) Hibernate Configuration
hibernate.default_schema=dbo
hibernate.default_catalog=XX
hibernate.database=SQL_SERVER
hibernate.dialect=org.hibernate.dialect.SQLServer2008Dialect
hibernate.show_sql=false
hibernate.generate_ddl=false
hibernate.hbm2ddl.auto=validate
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform
hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringJtaSessionContext
hibernate.connection.release_mode=auto

4) Runtime Exception in console
Caused by: javax.persistence.PersistenceException: org.hibernate.engine.jndi.JndiException: unable to find UserTransaction
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763) [hibernate-entitymanager-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) [hibernate-entitymanager-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1771) [hibernate-entitymanager-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.jpa.internal.TransactionImpl.begin(TransactionImpl.java:64) [hibernate-entitymanager-4.3.1.Final.jar:4.3.1.Final]
	at org.springframework.orm.jpa.DefaultJpaDialect.beginTransaction(DefaultJpaDialect.java:67) [spring-orm-4.0.1.RELEASE.jar:4.0.1.RELEASE]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:110) [spring-orm-4.0.1.RELEASE.jar:4.0.1.RELEASE]
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380) [spring-orm-4.0.1.RELEASE.jar:4.0.1.RELEASE]
	... 141 more
Caused by: org.hibernate.engine.jndi.JndiException: unable to find UserTransaction
	at org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform.locateUserTransaction(JBossAppServerJtaPlatform.java:77) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.retrieveUserTransaction(AbstractJtaPlatform.java:124) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.engine.transaction.internal.jta.JtaTransaction.locateUserTransaction(JtaTransaction.java:84) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.engine.transaction.internal.jta.JtaTransaction.doBegin(JtaTransaction.java:69) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:162) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1431) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.jpa.internal.TransactionImpl.begin(TransactionImpl.java:61) [hibernate-entitymanager-4.3.1.Final.jar:4.3.1.Final]
	... 144 more
Caused by: org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [java:jboss/UserTransaction]
	at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:117) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	at org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform.locateUserTransaction(JBossAppServerJtaPlatform.java:70) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]
	... 150 more
Caused by: javax.naming.NamingException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction [Root exception is java.lang.IllegalStateException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction]
	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:142)
	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:81)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
	at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
	at javax.naming.InitialContext.lookup(InitialContext.java:415) [rt.jar:1.7.0_51]
	at javax.naming.InitialContext.lookup(InitialContext.java:415) [rt.jar:1.7.0_51]
	at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114) [hibernate-core-4.3.1.Final.jar:4.3.1.Final]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list