aspose file tools*
The moose likes Other Application Frameworks and the fly likes javax.resource.ResourceException: enlist: caught Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "javax.resource.ResourceException: enlist: caught Exception" Watch "javax.resource.ResourceException: enlist: caught Exception" New topic
Author

javax.resource.ResourceException: enlist: caught Exception

Neal Sharman
Greenhorn

Joined: Oct 24, 2007
Posts: 16
I am running into the following error:

javax.resource.ResourceException: enlist: caught Exception
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:688)
at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:1881)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2219)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:643)
... 67 more
Caused by:
com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
at com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredResources.java:416)
at com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:3165)
at com.ibm.ws.Transaction.JTA.TranManagerSet.enlistOnePhase(TranManagerSet.java:441)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:585)


I am trying to access a DAO using Spring and Hibernate from an EJB SLSB (CMT). The database is on an iseries server and is DB2. The app server is WAS 6.1 The hibernate properties I am using:


<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.DB2400Dialect</prop>
<prop key="hibernate.connection.release_more">auto</prop>
<prop key="hibernate.connection.isolation">0</prop>
<prop key="hibernate.connection.autocommit">true</prop>
<!--
<prop key="hibernate.c3p0.minPoolSize">5</prop>
<prop key="hibernate.c3p0.maxPoolSize">20</prop>
<prop key="hibernate.c3p0.timeout">600</prop>
<prop key="hibernate.c3p0.max_statement">50</prop>
-->
<prop key="show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.use_sql_comments">true</prop>

<prop key="current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</prop>

<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</prop>

</props>

Strangely this seems to happen for only one query ( Ihave included the code below):

Query qry = session.getNamedQuery(VinSearchItem.class.getName() + vinSearchQry)
.setString("companyCode", companyCode)
.setString("productType", productType)
.setString("dealerNo", dealerNo)
.setString("vinPart", "%" + vinPart);

List vins = qry.list();

All other queries work fine. Any feed back will be greatly appreciated. I am sure I am messing up on some configuration parameter.

 
 
subject: javax.resource.ResourceException: enlist: caught Exception