java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: Wrong XAState: 3

Oracle Community | cain05 | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Is there a way to get Glassfish to automatically re-connect to SQL Server?

    Oracle Community | 6 years ago | cain05
    java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: Wrong XAState: 3
  2. 0

    How to redirect select queries to replicated database using non-jta-data-source in Spring application

    Stack Overflow | 6 months ago | macfeliga
    java.lang.IllegalStateException: Local transaction already has 1 non-XA Resource: cannot add more resources.

    2 unregistered visitors

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Wrong XAState: 3

      at com.sun.jts.jta.TransactionState.startAssociation()
    2. Embedded GlassFish Web
      JavaEETransactionManagerSimplified.enlistResource
      1. com.sun.jts.jta.TransactionState.startAssociation(TransactionState.java:322)
      2. com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:212)
      3. com.sun.enterprise.transaction.JavaEETransactionImpl.enlistResource(JavaEETransactionImpl.java:639)
      4. com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.enlistDistributedNonXAResource(JavaEETransactionManagerJTSDelegate.java:301)
      5. com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.enlistResource(JavaEETransactionManagerSimplified.java:384)
      5 frames
    3. Connectors Runtime
      ConnectionManagerImpl.allocateConnection
      1. com.sun.enterprise.resource.rm.ResourceManagerImpl.registerResource(ResourceManagerImpl.java:152)
      2. com.sun.enterprise.resource.rm.ResourceManagerImpl.enlistResource(ResourceManagerImpl.java:112)
      3. com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:208)
      4. com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:338)
      5. com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:301)
      6. com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
      7. com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
      8. com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
      8 frames
    4. Embedded GlassFish Web
      DataSource.getConnection
      1. com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)
      1 frame
    5. com.foo.dao
      PersistenceManager.persist
      1. com.foo.dao.PersistenceManager.initConnection(PersistenceManager.java:203)
      2. com.foo.dao.PersistenceManager.persist(PersistenceManager.java:376)
      2 frames
    6. com.foo.ejb
      PersistListenerEJB.onMessage
      1. com.foo.ejb.message.PersistListenerEJB.onMessage(PersistListenerEJB.java:42)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    8. Embedded GlassFish Web
      MessageBeanListenerImpl.deliverMessage
      1. org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
      2. org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
      3. com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:4154)
      4. com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5346)
      5. com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
      6. com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1093)
      7. com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:81)
      7 frames
    9. Connectors Inbound Support
      MessageEndpointInvocationHandler.invoke
      1. com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:171)
      1 frame
    10. Unknown
      $Proxy383.onMessage
      1. $Proxy383.onMessage(Unknown Source)
      1 frame
    11. com.sun.messaging
      OnMessageRunner.run
      1. com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:260)
      1 frame
    12. Embedded GlassFish Web
      OneWork.doWork
      1. com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
      1 frame
    13. glassfish-corba-orbgeneric
      ThreadPoolImpl$WorkerThread.run
      1. com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
      2. com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
      2 frames