File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes An illegal attempt to commit a one phase capable resource with existing two phase-WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "An illegal attempt to commit a one phase capable resource with existing two phase-WAS" Watch "An illegal attempt to commit a one phase capable resource with existing two phase-WAS" New topic
Author

An illegal attempt to commit a one phase capable resource with existing two phase-WAS

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I listen to message in Message Driven bean. I use Datasource to insert record in DB2 from onMessage(..) by calling other DataAccess POJO classes using Datasource. I have done all configurations in WSAD test server and hitting DB2.

When I debug my code, I see that I can insert to DB2 and even can close connection without any Exception. However, the transaction gets rolled back with following exception message:

[11/11/05 17:21:32:265 EST] 639d639d WSRdbDataSour I DSRA8203I: Database product name : DB2
[11/11/05 17:21:32:281 EST] 639d639d WSRdbDataSour I DSRA8204I: Database product version : 07.01.0001
[11/11/05 17:21:32:281 EST] 639d639d WSRdbDataSour I DSRA8205I: JDBC driver name : IBM DB2 JDBC 2.0 Type 2
[11/11/05 17:21:32:281 EST] 639d639d WSRdbDataSour I DSRA8206I: JDBC driver version : 07.02.0000
[11/11/05 17:21:41:031 EST] 639d639d RegisteredRes E WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.
[11/11/05 17:21:41:218 EST] 639d639d ServerSession W WMSG0031E: Exception processing JMS Message for MDB ArchiveIngest, JMSDestination jms/SAM.TEST : javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
com.ibm.ws.exception.WsEJBException
at java.lang.Throwable.<init>(Throwable.java)
at javax.ejb.EJBException.<init>(EJBException.java:26)
at com.ibm.ws.exception.WsEJBException.<init>(WsEJBException.java:105)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:159)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3128)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)
javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java:73)
at javax.ejb.EJBException.<init>(EJBException.java:50)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSIException(LocalExceptionMappingStrategy.java:96)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:165)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3128)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:372)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)

What settings do I need in WSAD test server?
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2056
The problem might be related to JTA.

If you have more than 1 resource, you can have at most, only 1 non-xa driver. For example, if you have 5 resources, at least 4 must be using xa drivers. In other words, you cannot have more than 1 non-xa driver in that situation.

In your case, your mdb uses 1 resource(your queue or topic), and the second is db2.

I think you are using 2 non-xa drivers.

This is a popular error met. You can search this forum and lots of cases.

Here is one.

All you need to do, since you have only 2 resources, is make one of them use xa.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: An illegal attempt to commit a one phase capable resource with existing two phase-WAS