1 Reply Latest reply on Sep 26, 2014 1:52 AM by Maciej Swiderski

    [Need Help]bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

    James Yu Newbie

      Hi all,

       

      I follow the following URL

      http://docs.codehaus.org/display/BTM/Tomcat

       

      and I have the {CATALINA_HOME}\webapps\{MY_APP}\META-INF\context.xml configured like this:

      <Context>

          <Resource name="jdbc/testDS" auth="Container" type="javax.sql.DataSource"

              factory="bitronix.tm.resource.

      ResourceObjectFactory" uniqueName="jdbc/testDS" />
      </Context>

       

      I can deploy {MY_APP} to tomcat and startup tomcat successfully, but got exception when running the servlet.

      Any idea ?

       

      The exception I got is:

      java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

          org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:131)

          org.drools.persistence.jta.JtaTransactionManager.<init>(JtaTransactionManager.java:79)

          org.drools.persistence.SingleSessionCommandService.initTransactionManager(SingleSessionCommandService.java:298)

          org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:90)

          sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

          sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

          java.lang.reflect.Constructor.newInstance(Constructor.java:526)

          org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:150)

          org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:70)

          org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:39)

          com.fet.sdp.poc.bpm.BPMService01.startCCDeductProcess(BPMService01.java:135)

          com.fet.sdp.poc.xmlrest.service.services.POCService.get01(POCService.java:36)

          sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          java.lang.reflect.Method.invoke(Method.java:606)

          org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)

          org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)

          org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:165)

          org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:92)

          org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

          java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

          java.util.concurrent.FutureTask.run(FutureTask.java:262)

          org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

          org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

          org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)

          org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

          org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)

          org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:209)

          org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:152)

          org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:114)

          org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)

          org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:113)

          javax.servlet.http.HttpServlet.service(HttpServlet.java:620)

          org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)

          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)