Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with transation on XA driver WAS 6.0

20 views
Skip to first unread message

Gautam Dey

unread,
Sep 1, 2006, 5:07:14 PM9/1/06
to
Dear All,

I am sharing a problem with you all.
I have written a stateless session bean (name First), this ejb has two
method namely "hello()" and "hello1()".
I am doing a lookup for this ejb from a jsp page, and I am calling the
"hello()" method.
The "hello()" medhod is looking up for a datasource "abc" ( XA driver Oracle
9i datasource) and executing a select statment on the connection object.
After that the function again does a lookup for the EJB (First ) that is a
call to its own EJB and this time ii calls the "hello1()" method. The
"hello1()"method lookup another datasource "xyz" ( XA driver Oracle 9i
datasource) and execute a select statment on the connection object. I get th
e following error.

res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]

res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)

[9/1/06 19:40:43:923 IST] 0000002f WSRdbDataSour I DSRA8203I: Database
product name : Oracle
[9/1/06 19:40:43:973 IST] 0000002f WSRdbDataSour I DSRA8204I: Database
product version : Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
[9/1/06 19:40:43:983 IST] 0000002f WSRdbDataSour I DSRA8205I: JDBC driver
name : Oracle JDBC driver
[9/1/06 19:40:44:093 IST] 0000002f WSRdbDataSour I DSRA8206I: JDBC driver
version : 9.2.0.6.0
[9/1/06 19:40:44:143 IST] 0000002f WSRdbDataSour I DSRA8208I: JDBC driver
type : ""
[9/1/06 19:40:49:932 IST] 0000002f WSRdbXaResour E DSRA0304E: XAException
occurred. XAException contents and details are:
The XA Error is : -3
The XA Error message is : A resource manager error has occured in the
transaction branch.
The Oracle Error code is : 600
The Oracle Error message is: Internal XA Error
The cause is : null.
[9/1/06 19:40:49:952 IST] 0000002f WSRdbXaResour E DSRA0302E: XAException
occurred. Error code is: XAER_RMERR (-3). Exception is: <null>
[9/1/06 19:40:50:042 IST] 0000002f XATransaction E J2CA0027E: An exception
occurred while invoking start on an XA Resource Adapter from dataSource abc
, within transaction ID {XidImpl: formatId(57415344), gtrid_length(36),
bqual_length(54),
data(0000010d69b795860000000100000001a88bba0f92dc26153872a42d8b2e19ed6e60ab8
10000010d69b795860000000100000001a88bba0f92dc26153872a42d8b2e19ed6e60ab81000
000010000000000000000000000000001)}: oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1270)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:318)
at
com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:
1312)
at
com.ibm.ejs.j2c.XATransactionWrapper.start(XATransactionWrapper.java:1293)
at
com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:140)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.startRes(RegisteredResources.
java:1091)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredReso
urces.java:507)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.ja
va:2822)
at
com.ibm.ws.Transaction.JTA.TranManagerSet.enlist(TranManagerSet.java:375)
at
com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:627)
at
com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:1734)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedC
onnectionImpl.java:2015)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdb
cConnection.java:547)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1069)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1048)
at com.labvantage.sapphire.FirstBean.hello(FirstBean.java:83)
at com.labvantage.sapphire.EJSRemoteStatelessFirst_0c4f64d2.hello(Unknown
Source)
at
com.labvantage.sapphire._FirstRemote_Stub.hello(_FirstRemote_Stub.java:252)
at com.ibm._jsp._test._jspService(_test.java:93)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1
212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.
java:629)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(Gener
icServletWrapper.java:117)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPE
xtensionServletWrapper.java:171)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtens
ionProcessor.java:230)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(Ht
tpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(Ht
tpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.j
ava:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscrimin
aters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewCon
nectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManage
r.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java
:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java
:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.jav
a:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
.
[9/1/06 19:40:50:122 IST] 0000002f RegisteredRes E WTRN0078E: An attempt
by the transaction manager to call start on a transactional resource has
resulted in an error. The error code was XAER_RMERR. The exception stack
trace follows: oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1270)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:318)
at
com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:
1312)
at
com.ibm.ejs.j2c.XATransactionWrapper.start(XATransactionWrapper.java:1293)
at
com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:140)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.startRes(RegisteredResources.
java:1091)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredReso
urces.java:507)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.ja
va:2822)
at
com.ibm.ws.Transaction.JTA.TranManagerSet.enlist(TranManagerSet.java:375)
at
com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:627)
at
com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:1734)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedC
onnectionImpl.java:2015)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdb
cConnection.java:547)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1069)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1048)
at com.labvantage.sapphire.FirstBean.hello(FirstBean.java:83)
at com.labvantage.sapphire.EJSRemoteStatelessFirst_0c4f64d2.hello(Unknown
Source)
at
com.labvantage.sapphire._FirstRemote_Stub.hello(_FirstRemote_Stub.java:252)
at com.ibm._jsp._test._jspService(_test.java:93)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1
212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.
java:629)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(Gener
icServletWrapper.java:117)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPE
xtensionServletWrapper.java:171)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtens
ionProcessor.java:230)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(Ht
tpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(Ht
tpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.j
ava:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscrimin
aters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewCon
nectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManage
r.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java
:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java
:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.jav
a:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

[9/1/06 19:40:50:282 IST] 0000002f XATransaction E J2CA0030E: Method
enlist caught javax.transaction.SystemException: XAResource start
association error:XAER_RMERR
at
com.ibm.ws.Transaction.JTA.RegisteredResources.startRes(RegisteredResources.
java:1141)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredReso
urces.java:507)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.ja
va:2822)
at
com.ibm.ws.Transaction.JTA.TranManagerSet.enlist(TranManagerSet.java:375)
at
com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:627)
at
com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:1734)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedC
onnectionImpl.java:2015)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdb
cConnection.java:547)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1069)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:1048)
at com.labvantage.sapphire.FirstBean.hello(FirstBean.java:83)
at com.labvantage.sapphire.EJSRemoteStatelessFirst_0c4f64d2.hello(Unknown
Source)
at
com.labvantage.sapphire._FirstRemote_Stub.hello(_FirstRemote_Stub.java:252)
at com.ibm._jsp._test._jspService(_test.java:93)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1
212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.
java:629)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(Gener
icServletWrapper.java:117)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPE
xtensionServletWrapper.java:171)
at
com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtens
ionProcessor.java:230)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(Ht
tpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(Ht
tpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.j
ava:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscrimin
aters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewCon
nectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManage
r.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java
:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java
:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.jav
a:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
while trying to enlist resources from datasource abc with the Transaction
Manager for the current transaction, and threw a ResourceException.


The source code for the two method of the ejb is as follows :

public String hello() {
Context initialContext = null;
Connection con = null;
try {
initialContext = new InitialContext();
}
catch (NamingException e) {
System.out.println("Naming Exception::" + e.getMessage());
}

try {
DataSource dataSource = (DataSource)
initialContext.lookup("abc");
con = dataSource.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from server");
rs.close();
st.close();

} catch (Exception e) {
System.out.println("Naming Exception::" + e.getMessage());
}

FirstHome firstHome = null;
FirstRemote first = null;
String h = null;

try {
System.out.println("doing a lookup second time");
Object objref = initialContext.lookup("ejb/First");
firstHome = (FirstHome)
javax.rmi.PortableRemoteObject.narrow(objref, FirstHome.class);
first = firstHome.create();
h = first.hello1();
} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use
File | Settings | File Templates.
}
return h + "####hello world#####";
}


public String hello1() {
Context initialContext = null;
Connection con = null;
try {
initialContext = new InitialContext();
}
catch (NamingException e) {
System.out.println("Naming Exception::" + e.getMessage());
}

try {
DataSource dataSource = (DataSource)
initialContext.lookup("xyz");
con = dataSource.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from sysuser");
rs.close();
st.close();

} catch (Exception e) {
System.out.println("Naming Exception::" + e.getMessage());
}

return "######hello1 world#####";
}

I am using WAS 6.0 development version.

I have been stuck with it for two week without being able to find a soution,
one thing I cant do it changing the code.
If anybody help me out finding a solution to it I will be realy obliged and
greatfull.Thanks in advance for your support and your help.
Thanks and regards
Gautam Dey


0 new messages