3 Replies Latest reply on Mar 5, 2002 6:40 AM by Rajarshi

    [JCA] XAResource.start failure doesn't provoke a ResourceExc

    Sylvain Laurent Newbie

      Hi all , Hi David !

      When a connection factory calls ConnectionManager.allocateConnection, a side effect is that a ManagedConnection is taken from the pool (or instanciated) and then XAResource.start is called (if we are in a transaction of course).
      So, if XAResource.start throws a XAException, it seems that the exception is not propagated up to the connection factory. I thought that the call to ConnectionManager.allocateConnection would have returned with a ResourceException...
      Because currently since no ResourceException is thrown, beans can go on using the connector even though the connector transaction context failed to be set up.
      I'm using JBoss 2.4.3, and I didn't check with jboss 3. Please tell me if it has been corrected in a later version.

        • 1. Re: [JCA] XAResource.start failure doesn't provoke a Resourc
          David Jencks Master

          No it hasn't, TxCapsule catches XAExceptions from failed starts and returns false, which is ignored?!?!?!?

          I will ask on the devel forum, this doesn't look right to me.

          Thanks

          • 2. Re: [JCA] XAResource.start failure doesn't provoke a Resourc
            David Jencks Master

            A little more inspection of the specs reveals the problem is in the XAConnectionListener. I have a fix that I will check into 3.0 after I can get jboss to compile again ;-)

            • 3. Re: [JCA] XAResource.start failure doesn't provoke a Resourc
              Rajarshi Newbie

              Hello David,
              I am having two virtual directory in IIS.Both gives a call to JBoss-2.4.3(with tomcat3.2.3)from an Html page after which the control is controlled by JBoss.
              When I use only one Virtual Dir then everything works fine.But in case of two Virtual Directory users I am often getting the XAException as follows:

              ingmateDS] Pool LearningmateDS [0/2/Unlimited] returned object org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl@39e5b5 to the pool.
              lt] In loadcourse
              lt] ejbFindByUserName.FindByUserID 555 called for schoolabhi0301 and course L001_CO_73533 and schoolChain abhi0301and batchID= Course_T1
              ntCoursePosition] XAException: tx=XidImpl [FormatId=257, GlobalId=dte//38, BranchQual=] errorCode=XAER_PROTO
              ntCoursePosition] javax.transaction.xa.XAException
              ntCoursePosition] at org.jboss.pool.jdbc.xa.wrapper.XAResourceImpl.start(XAResourceImpl.java:255)
              ntCoursePosition] at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1087)
              ntCoursePosition] at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:614)
              ntCoursePosition] at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:111)
              ingmateDS] java.lang.IllegalArgumentException: null xaRes
              ntCoursePosition] at org.jboss.pool.jdbc.xa.XAConnectionFactory.prepareObject(XAConnectionFactory.java:290)
              ntCoursePosition] at org.jboss.pool.ObjectPool.getObject(ObjectPool.java:566)
              lt] PageInfoEJB.Inside EJB Load()
              ntCoursePosition] at org.jboss.pool.ObjectPool.getObject(ObjectPool.java:538)
              ntCoursePosition] at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:178)
              ntCoursePosition] at lmate.Util.ConnectionMgr.getConnection(ConnectionMgr.java:33)
              ntCoursePosition] at lmate.EJB.Entity.CurrentCoursePositionEJB.ejbFindByUserName(CurrentCoursePositionEJB.java:139)
              ntCoursePosition] at java.lang.reflect.Method.invoke(Native Method)
              ntCoursePosition] at org.jboss.ejb.plugins.BMPPersistenceManager.callFinderMethod(BMPPersistenceManager.java:474)
              ntCoursePosition] at org.jboss.ejb.plugins.BMPPersistenceManager.findEntity(BMPPersistenceManager.java:227)
              lt] PageInfoEJB.Data Loaded
              ntCoursePosition] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:594)
              lt] PageInfoEJB.Values set
              ntCoursePosition] at java.lang.reflect.Method.invoke(Native Method)
              lt] PageInfoEJB.Inside EJB Load()
              ntCoursePosition] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:843)
              lt] PageInfoEJB.Data Loaded
              ntCoursePosition] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:231)
              lt] PageInfoEJB.Values set
              ntCoursePosition] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:154)
              lt] PageInfoEJB.Inside EJB Load()
              ntCoursePosition] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:108)
              lt] PageInfoEJB.Data Loaded
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
              lt] PageInfoEJB.Values set
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
              lt] PageInfoEJB.Inside EJB Load()
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
              lt] PageInfoEJB.Data Loaded
              ntCoursePosition] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:103)
              lt] PageInfoEJB.Values set
              ntCoursePosition] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
              lt] EJBStore of pageinfo : L001_PA_60650
              ntCoursePosition] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:441)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:237)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)
              ntCoursePosition] at $Proxy58.findByUserName(Unknown Source)
              ntCoursePosition] at lmate.EJB.Session.SessionControllerEJB.loadCourse(SessionControllerEJB.java:121)
              ntCoursePosition] at java.lang.reflect.Method.invoke(Native Method)
              ntCoursePosition] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:650)
              ntCoursePosition] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
              ntCoursePosition] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:243)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
              ntCoursePosition] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
              ntCoursePosition] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:341)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:489)
              lt] EJBStore of pageinfo : L001_PA_60651
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136)
              ntCoursePosition] at $Proxy51.loadCourse(Unknown Source)
              lt] EJBStore of pageinfo : L001_PA_60652
              ntCoursePosition] at lmate.EJB.Session.NavigatorEJB.startCourse(NavigatorEJB.java:185)
              ntCoursePosition] at lmate.EJB.Session.NavigatorEJB.getLastLoginPosition(NavigatorEJB.java:3452)
              ntCoursePosition] at java.lang.reflect.Method.invoke(Native Method)
              ntCoursePosition] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:650)
              ntCoursePosition] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
              lt] EJBStore of pageinfo : L001_PA_60653
              ntCoursePosition] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:243)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
              ntCoursePosition] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
              ntCoursePosition] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
              ntCoursePosition] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:341)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:395)
              ingmateDS] Pool LearningmateDS [0/2/Unlimited] returned object org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl@39e5b5 to the pool.
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:476)
              lt] stopSessionTimer...........sessionTimeThread..Thread[0zr2tvxrb1,5,main]
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
              ntCoursePosition] at org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136)
              ntCoursePosition] at $Proxy53.getLastLoginPosition(Unknown Source)
              ntCoursePosition] at lmate.Util.NavigatorHandler.getLastLoginPosition(NavigatorHandler.java:90)
              ntCoursePosition] at _0002fContent_0002ejspContent_jsp_1._jspService(_0002fContent_0002ejspContent_jsp_1.java:489)
              ntCoursePosition] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
              ntCoursePosition] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              ntCoursePosition] at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
              ntCoursePosition] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              ntCoursePosition] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
              ntCoursePosition] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
              ntCoursePosition] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
              ntCoursePosition] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              ntCoursePosition] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
              ntCoursePosition] at org.apache.tomcat.core.Handler.service(Handler.java:287)
              ntCoursePosition] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
              ntCoursePosition] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
              ntCoursePosition] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
              ntCoursePosition] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
              ntCoursePosition] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
              ntCoursePosition] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
              ntCoursePosition] at java.lang.Thread.run(Unknown Source)
              ingmateDS] Resource 'org.jboss.pool.jdbc.xa.wrapper.XAResourceImpl@34d39c' enlisted for 'org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl@39e5b5'.
              ingmateDS] Pool LearningmateDS [0/2/Unlimited] gave out pooled object: org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl@39e5b5
              lt] ejbFindByUser.in finder After Executing the Query
              lt] ejbFindByUser.in finder73695
              lt] in try loadcourse
              lt] Inside EJB Load()
              lt] ejbLoad().Before print pk
              lt] 73695
              lt] ejbLoad().Before query
              lt] ejbLoad().After query
              lt] ejbLoad().Data Loaded CurrentCoursePosition
              lt] Data Loaded1
              lt] ejbLoad().Values set CurrentCoursePositionID=73695
              lt] COURSE_END
              lt] In loadcourse
              lt] MaxPosition.ejbFindByUserName.FindByUserID 555 called for schoolabhi0301 and course L001_CO_73533 and schoolChain abhi0301and batchID= Course_T1
              lt] MaxPosition.ejbFindByUser.in finder After Executing the Query
              lt] ejbFindByUser.in finder73696
              lt] in try loadMaximumPosition
              lt] MaxPosition.Inside EJB Load()
              lt] MaxPosition.ejbLoad().Before print pk
              lt] 73696
              lt] MaxPosition.ejbLoad().Before query
              lt] MaxPosition.ejbLoad().After query
              lt] MaxPosition.ejbLoad().Data Loaded CurrentCoursePosition
              lt] Data Loaded1
              lt] MaxPosition.ejbLoad().Values set MaxPositionID=73696
              lt] loadMaximumPosition=COURSE_AFTER
              lt] after calling loadCourse
              lt] Getting currentposition
              lt] COURSE_END
              lt] Getting courseId
              lt] Getting currentposition
              lt] Inside NAvigator.getLastLoginPosition.course_end
              lt] Getting currentposition
              lt] getCourseEnd Entered..................................................CP..COURSE_END
              lt] Getting courseId
              lt] Getting currentposition
              lt] getCourseEnd Entered..................................................CP..2.......COURSE_END
              lt] Getting currentposition
              lt] getCourseEnd Entered..................................................CP..3....COURSE_END
              lt] Getting currentposition
              lt] getCourseEnd Entered..................................................CP..7....COURSE_END
              lt] NAV.isTestAlreadyComplete : Inside TestID =L001_TE_73529
              lt] TestInfoLogForCourseTest............................................
              lt] Getting courseId
              lt] TestInfoLog.ejbFindTestInfoLogForCourseTest.TEst ID= L001_TE_73529schoolID= abhi0301SchoolChainID= abhi0301 AdmissionNumber= 555 BatchID = Course_T1 BatchType = C COurseID=L001_CO
              lt] TestInfoLog.ejbFindTestInfoLogForCourseTest.Data Loaded rs= org.jboss.pool.jdbc.ResultSetInPool@5ac5f
              lt] TestInfoLog.Inside EJB Load()
              lt] TestInfoLog.EJBLOAD.Data Loaded
              lt] Values set
              lt] TestInfoLogForCourseTest...........................................returning with true.........
              lt] IsTestAlreadyComplete.returning with Value= true
              lt] Inside CourseEnd Course PostTest is NOT ........ nullTest

              Please tell me if there is any solution.