File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes stackoverflow JTATransactionFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "stackoverflow JTATransactionFactory" Watch "stackoverflow JTATransactionFactory" New topic
Author

stackoverflow JTATransactionFactory

Yasir Qureshi
Greenhorn

Joined: Apr 26, 2006
Posts: 24
I am using hibernate(3.3.1.GA) and tomcat (6.0.18), I am getting Stackoverflow exception, I have googled but could not found the fix.

This is my hibernate config file:

<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/xxxx</property>
<property name="hibernate.connection.username">xxxx</property>
<property name="hibernate.connection.password">xxxx</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOTMTransactionManagerLookup</property>
<property name="hibernate.current_session_context_class">thread</property>

This is exception I am getting:

java.lang.StackOverflowError
java.security.AccessController.doPrivileged(Native Method)
com.sun.naming.internal.VersionHelper12.getContextClassLoader(Unknown Source)
com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
javax.naming.spi.NamingManager.getObjectFactoryFromReference(Unknown Source)
javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
org.apache.naming.NamingContext.lookup(NamingContext.java:793)
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
javax.naming.InitialContext.lookup(Unknown Source)
org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:162)

I found recursion in org.hibernate.transaction.JTATransactionFactory method:

protected UserTransaction getUserTransaction() {
log.trace( "Attempting to locate UserTransaction via JNDI [{}]", getUserTransactionName() );

try {
UserTransaction ut = ( UserTransaction ) getInitialContext().lookup( getUserTransactionName() );
if ( ut == null ) {
throw new TransactionException( "Naming service lookup for UserTransaction returned null [" + getUserTransactionName() +"]" );
}

log.trace( "Obtained UserTransaction" );

return ut;
}
catch ( NamingException ne ) {
throw new TransactionException( "Could not find UserTransaction in JNDI [" + getUserTransaction() + "]", ne );
}
}


Thanks.
Yasir Qureshi
Greenhorn

Joined: Apr 26, 2006
Posts: 24
No one experienced this issues ever before?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stackoverflow JTATransactionFactory