exception: Unable to use a wrapped JMS session in the transaction because two-phase commit is not available - Weblogic

This is a discussion on exception: Unable to use a wrapped JMS session in the transaction because two-phase commit is not available - Weblogic ; I am getting the following exception. The exception occurs regardless of whether the value of EnableTwoPhaseCommit for JDBCTxDataSource is true or false. The workaround is not to use resource ref for connection factory. However, whether the transaction commits or rolls ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: exception: Unable to use a wrapped JMS session in the transaction because two-phase commit is not available

  1. exception: Unable to use a wrapped JMS session in the transaction because two-phase commit is not available

    I am getting the following exception. The exception occurs regardless of
    whether the value of EnableTwoPhaseCommit for JDBCTxDataSource is true or
    false.

    The workaround is not to use resource ref for connection factory. However,
    whether the transaction commits or rolls back, the message is always sent
    and received

    I am expecting the data not to commit and the message to be never sent when
    EnableTwoPhaseCommit is true, resource ref is used or not, and transaction
    is rolled back.

    I will be more than happy to provide configurations or working code sample
    to demonstrate this problem...

    Workarounds and suggestions are most welcome.

    javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped JMS session in
    the transaction because two-phase commit is not available
    at
    weblogic.deployment.jms.JMSExceptions.getJMSExcept ion(JMSExceptions.java:22)
    at
    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInExistingTransact
    ion(WrappedTransactionalSession.java:146)
    at
    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInTransaction(Wrap
    pedTransactionalSession.java:190)
    at
    weblogic.deployment.jms.WrappedMessageProducer.sen d(WrappedMessageProducer.j
    ava:124)
    at
    com.malani.sem.agent.AgentFacadeBean.enqueuePerson (AgentFacadeBean.java:115)
    at
    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl.enq ueuePerson(AgentFacade_6js
    8s0_EOImpl.java:46)
    at com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_WLS kel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicS erverRef.java:466)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke( ReplicaAwareServerRef.java
    :108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicSe rverRef.java:409)
    at
    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    t.java:353)
    at
    weblogic.security.service.SecurityManager.runAs(Se curityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest (BasicServerRef.java:404)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute( BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    ; nested exception is:
    javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped JMS session in
    the transaction because two-phase commit is not available
    at
    weblogic.rjvm.BasicOutboundRequest.sendReceive(Bas icOutboundRequest.java:108
    )
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java
    :284)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java
    :244)
    at
    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_811 _WLStub.enqueuePerson(Unkn
    own Source)
    at
    com.malani.sem.agent.test.AgentFacadeTest.testProc essPerson(AgentFacadeTest.
    java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39
    )
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl
    ..java:25)
    at
    com.intellij.rt.execution.junit.TextTestRunner.mai n(TextTestRunner.java:12)
    Caused by: javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped JMS
    session in the transaction because two-phase commit is not available
    at
    weblogic.deployment.jms.JMSExceptions.getJMSExcept ion(JMSExceptions.java:22)
    at
    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInExistingTransact
    ion(WrappedTransactionalSession.java:146)
    at
    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInTransaction(Wrap
    pedTransactionalSession.java:190)
    at
    weblogic.deployment.jms.WrappedMessageProducer.sen d(WrappedMessageProducer.j
    ava:124)
    at
    com.malani.sem.agent.AgentFacadeBean.enqueuePerson (AgentFacadeBean.java:115)
    at
    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl.enq ueuePerson(AgentFacade_6js
    8s0_EOImpl.java:46)
    at com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_WLS kel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicS erverRef.java:466)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke( ReplicaAwareServerRef.java
    :108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicSe rverRef.java:409)
    at
    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    t.java:353)
    at
    weblogic.security.service.SecurityManager.runAs(Se curityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest (BasicServerRef.java:404)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute( BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)



  2. Re: exception: Unable to use a wrapped JMS session in the transaction because two-phase commit is not available

    The problem is solved. I didn't have the XA enabled on the connection
    factory

    "Carl" wrote in message news:3fecd2cd@newsgroups.bea.com...
    > I am getting the following exception. The exception occurs regardless of
    > whether the value of EnableTwoPhaseCommit for JDBCTxDataSource is true or
    > false.
    >
    > The workaround is not to use resource ref for connection factory.

    However,
    > whether the transaction commits or rolls back, the message is always sent
    > and received
    >
    > I am expecting the data not to commit and the message to be never sent

    when
    > EnableTwoPhaseCommit is true, resource ref is used or not, and transaction
    > is rolled back.
    >
    > I will be more than happy to provide configurations or working code sample
    > to demonstrate this problem...
    >
    > Workarounds and suggestions are most welcome.
    >
    > javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped JMS session

    in
    > the transaction because two-phase commit is not available
    > at
    >

    weblogic.deployment.jms.JMSExceptions.getJMSExcept ion(JMSExceptions.java:22)
    > at
    >

    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInExistingTransact
    > ion(WrappedTransactionalSession.java:146)
    > at
    >

    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInTransaction(Wrap
    > pedTransactionalSession.java:190)
    > at
    >

    weblogic.deployment.jms.WrappedMessageProducer.sen d(WrappedMessageProducer.j
    > ava:124)
    > at
    >

    com.malani.sem.agent.AgentFacadeBean.enqueuePerson (AgentFacadeBean.java:115)
    > at
    >

    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl.enq ueuePerson(AgentFacade_6js
    > 8s0_EOImpl.java:46)
    > at com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_WLS kel.invoke(Unknown
    > Source)
    > at weblogic.rmi.internal.BasicServerRef.invoke(BasicS erverRef.java:466)
    > at
    >

    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke( ReplicaAwareServerRef.java
    > :108)
    > at weblogic.rmi.internal.BasicServerRef$1.run(BasicSe rverRef.java:409)
    > at
    >

    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    > t.java:353)
    > at
    > weblogic.security.service.SecurityManager.runAs(Se curityManager.java:144)
    > at
    >

    weblogic.rmi.internal.BasicServerRef.handleRequest (BasicServerRef.java:404)
    > at
    >

    weblogic.rmi.internal.BasicExecuteRequest.execute( BasicExecuteRequest.java:3
    > 0)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    > ; nested exception is:
    > javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped JMS session

    in
    > the transaction because two-phase commit is not available
    > at
    >

    weblogic.rjvm.BasicOutboundRequest.sendReceive(Bas icOutboundRequest.java:108
    > )
    > at
    >

    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java
    > :284)
    > at
    >

    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke( ReplicaAwareRemoteRef.java
    > :244)
    > at
    >

    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_811 _WLStub.enqueuePerson(Unkn
    > own Source)
    > at
    >

    com.malani.sem.agent.test.AgentFacadeTest.testProc essPerson(AgentFacadeTest.
    > java:26)
    > at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    > at
    >

    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39
    > )
    > at
    >

    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl
    > .java:25)
    > at
    >

    com.intellij.rt.execution.junit.TextTestRunner.mai n(TextTestRunner.java:12)
    > Caused by: javax.jms.JMSException: [J2EE:160055]Unable to use a wrapped

    JMS
    > session in the transaction because two-phase commit is not available
    > at
    >

    weblogic.deployment.jms.JMSExceptions.getJMSExcept ion(JMSExceptions.java:22)
    > at
    >

    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInExistingTransact
    > ion(WrappedTransactionalSession.java:146)
    > at
    >

    weblogic.deployment.jms.WrappedTransactionalSessio n.enlistInTransaction(Wrap
    > pedTransactionalSession.java:190)
    > at
    >

    weblogic.deployment.jms.WrappedMessageProducer.sen d(WrappedMessageProducer.j
    > ava:124)
    > at
    >

    com.malani.sem.agent.AgentFacadeBean.enqueuePerson (AgentFacadeBean.java:115)
    > at
    >

    com.malani.sem.agent.AgentFacade_6js8s0_EOImpl.enq ueuePerson(AgentFacade_6js
    > 8s0_EOImpl.java:46)
    > at com.malani.sem.agent.AgentFacade_6js8s0_EOImpl_WLS kel.invoke(Unknown
    > Source)
    > at weblogic.rmi.internal.BasicServerRef.invoke(BasicS erverRef.java:466)
    > at
    >

    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke( ReplicaAwareServerRef.java
    > :108)
    > at weblogic.rmi.internal.BasicServerRef$1.run(BasicSe rverRef.java:409)
    > at
    >

    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    > t.java:353)
    > at
    > weblogic.security.service.SecurityManager.runAs(Se curityManager.java:144)
    > at
    >

    weblogic.rmi.internal.BasicServerRef.handleRequest (BasicServerRef.java:404)
    > at
    >

    weblogic.rmi.internal.BasicExecuteRequest.execute( BasicExecuteRequest.java:3
    > 0)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >
    >




+ Reply to Thread