Issue with OracleXA datasource (unable to enlist XAResource)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Hi ,

I am using 7.0.2 version of TomEE. And below is my resource configuration in tomee.xml file.

<Resource id="jdbc/dignesh" type="DataSource">
                XaDataSource Xa/ds
                UserName ****
                Password ****
                PasswordCipher ****
        </Resource>
<Resource id="XA/Datasource" class-name="oracle.jdbc.xa.client.OracleXADataSource">
                Url *****
                DataSourceCreator = dbcp
        </Resource>

I am seeing the unable to enlist XAResource error messages in the log file.

WARNING: Unable to enlist XAResource oracle.jdbc.driver.T4CXAResource@657d3ab1, errorCode: 4
oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1033)
        at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240)
        at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:202)
        at org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:134)
        at com.sun.proxy.$Proxy82.getAutoCommit(Unknown Source)
        at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.setAutoCommit(AttributeRestoringConnectionInvocationHandler.java:90)
        at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:66)
        at com.sun.proxy.$Proxy82.setAutoCommit(Unknown Source)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:799)
        at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:235)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobsAndTriggers(JobStoreSupport.java:1323)
        at org.quartz.core.QuartzScheduler.scheduleJobs(QuartzScheduler.java:1056)
        at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:1066)

Is there any other configuration to done which i am missing ?

Thank you,
Dignesh,
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
do you have the oracle error code before?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-03 16:15 GMT+02:00 Dignesh <[hidden email]>:

> Hi ,
>
> I am using 7.0.2 version of TomEE. And below is my resource configuration
> in
> tomee.xml file.
>
> <Resource id="jdbc/dignesh" type="DataSource">
>                 XaDataSource Xa/ds
>                 UserName ****
>                 Password ****
>                 PasswordCipher ****
>         </Resource>
> <Resource id="XA/Datasource"
> class-name="oracle.jdbc.xa.client.OracleXADataSource">
>                 Url *****
>                 DataSourceCreator = dbcp
>         </Resource>
>
> I am seeing the unable to enlist XAResource error messages in the log file.
>
> WARNING: Unable to enlist XAResource
> oracle.jdbc.driver.T4CXAResource@657d3ab1, errorCode: 4
> oracle.jdbc.xa.OracleXAException
>         at
> oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1033)
>         at
> oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240)
>         at
> org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(
> TransactionImpl.java:202)
>         at
> org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(
> ManagedConnection.java:134)
>         at com.sun.proxy.$Proxy82.getAutoCommit(Unknown Source)
>         at
> org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionIn
> vocationHandler.setAutoCommit(AttributeRestoringConnectionIn
> vocationHandler.java:90)
>         at
> org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionIn
> vocationHandler.invoke(AttributeRestoringConnectionIn
> vocationHandler.java:66)
>         at com.sun.proxy.$Proxy82.setAutoCommit(Unknown Source)
>         at
> org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(
> JobStoreSupport.java:799)
>         at
> org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(
> JobStoreCMT.java:235)
>         at
> org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobsAndTriggers(
> JobStoreSupport.java:1323)
>         at
> org.quartz.core.QuartzScheduler.scheduleJobs(QuartzScheduler.java:1056)
>         at
> org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:1066)
>
> Is there any other configuration to done which i am missing ?
>
> Thank you,
> Dignesh,
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-
> enlist-XAResource-tp4681459.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
No.
I just see only errorCode: 4 in the logs.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
can you ensure both xa and wrapper/pool have the user set correctly please?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-03 16:18 GMT+02:00 Dignesh <[hidden email]>:

> No.
> I just see only errorCode: 4 in the logs.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681461.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Below is my configuration in tomee.xml file.
So you mean i need to add username in "XA/Datasource" ?

<Resource id="jdbc/dignesh" type="DataSource">
                XaDataSource Xa/ds
                UserName ****
                Password ****
                PasswordCipher ****
        </Resource>
<Resource id="XA/Datasource" class-name="oracle.jdbc.xa.client.OracleXADataSource">
                Url *****
                DataSourceCreator = dbcp
        </Resource>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
User and Password (OracleXADataSource doesn't know about UserName field)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-03 16:23 GMT+02:00 Dignesh <[hidden email]>:

> Below is my configuration in tomee.xml file.
> So you mean i need to add username in "XA/Datasource" ?
>
> <Resource id="jdbc/dignesh" type="DataSource">
>                 XaDataSource Xa/ds
>                 UserName ****
>                 Password ****
>                 PasswordCipher ****
>         </Resource>
> <Resource id="XA/Datasource"
> class-name="oracle.jdbc.xa.client.OracleXADataSource">
>                 Url *****
>                 DataSourceCreator = dbcp
>         </Resource>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681463.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Added user and password - still i see the same issue.
<Resource id="XA/Datasource" class-name="oracle.jdbc.xa.client.OracleXADataSource">
                Url *****
                DataSourceCreator = dbcp
                User dignesh
                Password dignesh
        </Resource>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
is it a typo or not: datasource creator should be in the datasource, not
the xa impl (other resource to make it clear)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-03 16:31 GMT+02:00 Dignesh <[hidden email]>:

> Added user and password - still i see the same issue.
> <Resource id="XA/Datasource"
> class-name="oracle.jdbc.xa.client.OracleXADataSource">
>                 Url *****
>                 DataSourceCreator = dbcp
>                 User dignesh
>                 Password dignesh
>         </Resource>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681465.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
I have removed the DataSourceCreator = dbcp from the resource itself and tried, Still I see the issue.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
idea was if you want to use dbcp which seems the case you need to set it in
the other resource.

I'm not sure of the whole usage but looks like you use a CMT resource (XA
or JtaManaged=true) with a manual management of quartz which cant works
since the quartz store will try to manage the autocommit and the datasource
will not allow it


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-03 16:47 GMT+02:00 Dignesh <[hidden email]>:

> I have removed the DataSourceCreator = dbcp from the resource itself and
> tried, Still I see the issue.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681467.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Thank you Romain. I made the change.
Now when I shutdown the TomEE, it is not stopped. When I see the thread dump,It is freezed at this point. Is there any other configuration that needs to be added?

"localhost-startStop-2" daemon prio=6 tid=0x000000001a7cf000 nid=0x8bc runnable [0x0000000017fed000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at oracle.net.ns.Packet.receive(Packet.java:282)
        at oracle.net.ns.DataPacket.receive(DataPacket.java:103)
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:230)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:100)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:85)
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
        at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1179)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
        at oracle.jdbc.driver.T4CTTIOtxse.doOTXSE(T4CTTIOtxse.java:163)
        at oracle.jdbc.driver.T4CXAResource.doStart(T4CXAResource.java:185)
        - locked <0x0000000720c1adf8> (a oracle.jdbc.driver.T4CConnection)
        at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:228)
        - locked <0x0000000720c1adf8> (a oracle.jdbc.driver.T4CConnection)
        at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:202)
        - locked <0x00000006f7519400> (a org.apache.geronimo.transaction.manager.TransactionImpl)
        at org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:134)
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
2017-04-04 13:24 GMT+02:00 Dignesh <[hidden email]>:

> Thank you Romain. I made the change.
> Now when I shutdown the TomEE, it is not stopped. When I see the thread
> dump,It is freezed at this point. Is there any other configuration that
> needs to be added?
>
> "localhost-startStop-2" daemon prio=6 tid=0x000000001a7cf000 nid=0x8bc
> runnable [0x0000000017fed000]
>    java.lang.Thread.State: RUNNABLE
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(SocketInputStream.java:152)
>         at java.net.SocketInputStream.read(SocketInputStream.java:122)
>         at oracle.net.ns.Packet.receive(Packet.java:282)
>         at oracle.net.ns.DataPacket.receive(DataPacket.java:103)
>         at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.
> java:230)
>         at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
>         at oracle.net.ns.NetInputStream.read(NetInputStream.java:100)
>         at oracle.net.ns.NetInputStream.read(NetInputStream.java:85)
>         at
> oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(
> T4CSocketInputStreamWrapper.java:122)
>         at
> oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(
> T4CSocketInputStreamWrapper.java:78)
>         at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(
> T4CMAREngine.java:1179)
>         at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(
> T4CMAREngine.java:1155)
>         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
>         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
>         at oracle.jdbc.driver.T4CTTIOtxse.doOTXSE(T4CTTIOtxse.java:163)
>         at oracle.jdbc.driver.T4CXAResource.doStart(
> T4CXAResource.java:185)
>         - locked <0x0000000720c1adf8> (a oracle.jdbc.driver.T4CConnection)
>         at oracle.jdbc.xa.client.OracleXAResource.start(
> OracleXAResource.java:228)
>         - locked <0x0000000720c1adf8> (a oracle.jdbc.driver.T4CConnection)
>         at
> org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(
> TransactionImpl.java:202)
>         - locked <0x00000006f7519400> (a
> org.apache.geronimo.transaction.manager.TransactionImpl)
>         at
> org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(
> ManagedConnection.java:134)
>
>
>
Sure it is this dump? this thread is daemon so shouldnt prevent to stop.
ALso the rest of the stack would say which part of the code is triggered
(probably a bean call at shutdown).


>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681470.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Yes it is bean call at shutdown.
The thread is getting frezzed when I call connection.preparedStatement().
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
do you have a timeout on the datasource or something like that?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-04 13:36 GMT+02:00 Dignesh <[hidden email]>:

> Yes it is bean call at shutdown.
> The thread is getting frezzed when I call connection.preparedStatement().
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681473.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
No.Should it be added ? if yes can you please let me what needs to be added.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
the issue is a network issue from what we have in the dump so not related
to tomee. You need to check your infra and why you dont get the answer
there. Can also be a too "big" query.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-04 13:43 GMT+02:00 Dignesh <[hidden email]>:

> No.Should it be added ? if yes can you please let me what needs to be
> added.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681475.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Dignesh
Hi Romain,
I dont think it is a network issue. If I change it to a normal datasource from XA, it is working fine. And it is a simple delete query
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OracleXA datasource (unable to enlist XAResource)

Romain Manni-Bucau
then do you have a transaction?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-04-04 13:47 GMT+02:00 Dignesh <[hidden email]>:

> Hi Romain,
> I dont think it is a network issue. If I change it to a normal datasource
> from XA, it is working fine. And it is a simple delete query
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Issue-with-OracleXA-datasource-unable-to-enlist-XAResource-
> tp4681459p4681477.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>