Bitronix with AS400 DB2 database.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bitronix with AS400 DB2 database.

olonga
I am trying to use Bitronix for AS400 DB2 V5R2 database with tomcat/spring/hibernate.  Here is my Resource Loader:
resource.ds3.className=com.ibm.as400.access.AS400JDBCXADataSource
resource.ds3.uniqueName=jdbc/connAs400x
resource.ds3.minPoolSize=5
resource.ds3.maxPoolSize=30
resource.ds3.allowLocalTransactions=true
resource.ds3.driverProperties.serverName=jde.host.com
resource.ds3.driverProperties.databaseName=dbname
resource.ds3.driverProperties.user=myuser
resource.ds3.driverProperties.password=mypwd
resource.ds3.driverProperties.translateBinary=true

Tomcat starts up nicely.  However when I try to execute query (in this example to a table named PARTY via spring/hibernate DAO), it seems to think that 'myuser' is the the database instead of 'dbname' which is the name of the database I am trying to connect to.  Somewhere it is getting confused.  I am using the latest version of Bitronix.  Here is the exception hierarchy:

WARN - JDBCExceptionReporter.logExceptions(71) | SQL Error: -204, SQLState: 42704
ERROR - JDBCExceptionReporter.logExceptions(72) | [SQL0204] PARTY in MYUSER type *FILE not found.
Apr 29, 2008 4:15:17 PM bitronix.tm.internal.XAResourceManager delistUnclosedResources
WARNING: error delisting resource: an XAResourceHolderState with uniqueName=jdbc/connAs400x XAResource=MFSNT400-XA:RMID#49153 (started) with XID a Bitronix XID [746F6D6361742D62746D2D6E6F646530000001199C0A15EE00000007 : 746F6D6361742D62746D2D6E6F646530000001199C0A15F300000009]
bitronix.tm.internal.BitronixSystemException: cannot delist an XAResourceHolderState with uniqueName=jdbc/connAs400x XAResource=MFSNT400-XA:RMID#49153 (started) with XID a Bitronix XID [746F6D6361742D62746D2D6E6F646530000001199C0A15EE00000007 : 746F6D6361742D62746D2D6E6F646530000001199C0A15F300000009], error=XAER_RMFAIL
        at bitronix.tm.BitronixTransaction.delistResource(BitronixTransaction.java:90)
        at bitronix.tm.internal.XAResourceManager.delistUnclosedResources(XAResourceManager.java:125)
        at bitronix.tm.BitronixTransaction.rollback(BitronixTransaction.java:169)
        at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:105)
        at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:808)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:583)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)

        at $Proxy4.saveParty(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:54)
        at org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessage(ServiceInvocationHandler.java:271)
        at org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(ServiceInvocationHandler.java:84)
        at org.codehaus.xfire.service.binding.ServiceInvocationHandler.execute(ServiceInvocationHandler.java:132)
        at org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:107)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
        at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
        at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:301)
        at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:130)
        at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.xa.XAException
        at com.ibm.as400.access.AS400JDBCXAResource.throwXAException(AS400JDBCXAResource.java:966)
        at com.ibm.as400.access.AS400JDBCXAResource.end(AS400JDBCXAResource.java:364)
        at bitronix.tm.internal.XAResourceHolderState.end(XAResourceHolderState.java:114)
        at bitronix.tm.internal.XAResourceManager.delist(XAResourceManager.java:101)
        at bitronix.tm.BitronixTransaction.delistResource(BitronixTransaction.java:88)
        ... 55 more
Reply | Threaded
Open this post in threaded view
|

Re: Bitronix with AS400 DB2 database.

Ludovic Orban
Administrator
Hi,

This is definitely a problem purely related to DB2 AS400. That will make it very hard for me to reproduce it as I don't have access to such hardware and software.

Have you searched on IBM's website for examples of how to use the AS400JDBCXADataSource ?

I've found this link:
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.toolbox.doc/jdbcxa.htm

It looks like only user, password and serverName properties are needed according to it. You should take IBM's example as a starting point and modify it to find the correct settings of your environment.

Ludovic