Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.resource.ResourceException: enlist: caught Exception

Neal Sharman
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running into the following error:

javax.resource.ResourceException: enlist: caught Exception
... 67 more
Caused by: Illegal attempt to enlist multiple 1PC XAResources

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">
<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>


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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic