ClassNotFoundException on bitronix.tm.BitronixUserTransactionFactory

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ClassNotFoundException on bitronix.tm.BitronixUserTransactionFactory

James Yu
Hi all,

It seems that I have successfully configure Tomcat to run bitronix by following the materials provided on the following urls:
https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-wb/kie-wb-distribution-wars/src/main/tomcat7
http://www.bitronix.be/Btm/Tomcat55Howto
http://docs.codehaus.org/display/BTM/Tomcat

My {CATALINA_HOME}\conf\context.xml has this configured:
<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

My {CATALINA_HOME}\webapps\{MY_APP}\META-INF\context.xml has this configured:
<Context>
    <Resource name="jdbc/testDS" auth="Container" type="javax.sql.DataSource"
        factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/testDS" />
    <Transaction factory="bitronix.tm.BitronixUserTransactionFactory" />
</Context>

Everything looks fine when I startup tomcat.
However, when I send request to a servlet that suppose to use bitronix, it throws class not found exception on bitronix.tm.BitronixUserTransactionFactory

I put the following jar files to {CATALINA_HOME}\lib:
btm-2.1.4.jar
btm-tomcat55-lifecycle-2.1.4.jar
geronimo-jta_1.1_spec-1.1.1.jar
slf4j-api-1.6.4.jar
slf4j-jdk14-1.6.4.jar

Do I need to put extra jar files ?

Here is the log:
java.lang.ClassNotFoundException: bitronix.tm.BitronixUserTransactionFactory
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
	org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:80)
	javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
	org.apache.naming.NamingContext.lookup(NamingContext.java:842)
	org.apache.naming.NamingContext.lookup(NamingContext.java:153)
	org.apache.naming.NamingContext.lookup(NamingContext.java:830)
	org.apache.naming.NamingContext.lookup(NamingContext.java:167)
	org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
	javax.naming.InitialContext.lookup(InitialContext.java:411)
	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)




This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
+886988713275
Loading...