4 Replies Latest reply on Sep 15, 2014 8:43 AM by cyu021

    [Need Help] PoolingDataSource() works only in standalong java code

    cyu021

      Hi all,

       

      The following code snippet works find when I run it in standalone java program

          ds = new PoolingDataSource();
         ds.setUniqueName("jdbc/testDS");
          ds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource");
          ds.setAllowLocalTransactions(true);
          ds.setMaxPoolSize(3);
          ds.getDriverProperties().put("driverClassName", "com.mysql.jdbc.Driver");
          ds.getDriverProperties().put("Url", "jdbc:mysql://localhost:3306/jbpm");
          ds.getDriverProperties().put("password", "jbpm");
          ds.getDriverProperties().put("user", "jbpm");
          ds.init();
        
         kservices = KieServices.Factory.get();
         kstore = kservices.getStoreServices();
        
         //Create an environment variable with all the database configuration content
         environment = kservices.newEnvironment();
         EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

       

      but when I try to run the same code in Tomcat I got this error:

      Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [jdbc/testDS]

          at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)

          at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)

          at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)

          at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)

          at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)

          at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)

          at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1825)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1783)

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)

          ... 51 more

      Caused by: javax.naming.NameNotFoundException: Name [jdbc/testDS] is not bound in this Context. Unable to find [jdbc].

          at org.apache.naming.NamingContext.lookup(NamingContext.java:819)

          at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

          at org.apache.naming.SelectorContext.lookup(SelectorContext.java:133)

          at javax.naming.InitialContext.lookup(InitialContext.java:415)

          at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65)

          ... 64 more

       

      Even if I enable bitronix in Tomcat and comment out ds part of the code, I still get the same error.

        • 1. Re: [Need Help] PoolingDataSource() works only in standalong java code
          swiderski.maciej

          here you can find instruction on how to configure tomcat to work with jbpm.

           

          HTH

          • 2. Re: Re: [Need Help] PoolingDataSource() works only in standalong java code
            cyu021

            Hi Maciej,

             

            My app still experience "NameNotFoundException" when create EntityManagerFactory.

            Code I use to create EntityManagerFactory:

            EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

            The last exception from the stack trace:

            Unable to lookup JNDI name [jdbc/testDS]

             

            I follow the materials provided in:

            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

             

            and the content of my local files are:

            [CATALINA_HOME\conf\btm-config.properties]

            bitronix.tm.serverId=tomcat-btm-node0

            bitronix.tm.journal.disk.logPart1Filename=${btm.root}\work\btm1.tlog

            bitronix.tm.journal.disk.logPart2Filename=${btm.root}\work\btm2.tlog

            bitronix.tm.resource.configuration=${btm.root}\conf\resources.properties

             

            [CATALINA_HOME\conf\resources.properties]

            resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource

            resource.ds1.uniqueName=jdbc/testDS

            resource.ds1.minPoolSize=10

            resource.ds1.maxPoolSize=20

            resource.ds1.driverProperties.driverClassName=com.mysql.jdbc.Driver

            resource.ds1.driverProperties.url=jdbc:mysql://localhost:3306/jbpm

            resource.ds1.driverProperties.user=jbpm

            resource.ds1.driverProperties.password=jbpm

            resource.ds1.allowLocalTransactions=true

             

            [CATALINA_HOME\bin\setenv.bat]

            CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=%CATALINA_HOME% -Dbitronix.tm.configuration=%CATALINA_HOME%\conf\btm-config.properties -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry"

             

            [CATALINA_HOME\webapps\{MYAPP}\META-INF\context.xml]

            <Context path="/dbtest">

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

                    factory="bitronix.tm.resource.ResourceFactory" uniqueName="jdbc/testDS" />

                <Transaction factory="bitronix.tm.BitronixUserTransactionFactory" />

            </Context>

             

            [CATALINA_HOME\conf/web.xml]

            ...

              <resource-env-ref>

                <description>

                  DB Connection

                </description>

                <resource-env-ref-name>

                  jdbc/testDS

                </resource-env-ref-name>

                <resource-env-ref-type>

                  javax.sql.DataSource

                </resource-env-ref-type>

              </resource-env-ref>

            ...

             

            [CATALINA_HOME\conf\server.xml]

            ...

              <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

              <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />

              <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

            ...

             

            [CATALINA_HOME\conf\context.xml]

            ...

            <WatchedResource>WEB-INF/web.xml</WatchedResource>

              <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

            ...

             

            [CATALINA_HOME\webapps\{MYAPP}\WEB-INF\classes\META-INF\persistence.xml]

            ...

              <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

                <provider>org.hibernate.ejb.HibernatePersistence</provider>

                <jta-data-source>jdbc/testDS</jta-data-source>      

                <mapping-file>META-INF/JBPMorm.xml</mapping-file>

            ...

             

            and following is the error message I startup my Tomcat:

            Sep 15, 2014 3:21:57 PM org.apache.catalina.core.AprLifecycleListener init

            INFO: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.4.8.

            Sep 15, 2014 3:21:57 PM org.apache.catalina.core.AprLifecycleListener init

            INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

            Sep 15, 2014 3:21:58 PM org.apache.catalina.core.AprLifecycleListener initializeSSL

            INFO: OpenSSL successfully initialized (OpenSSL 1.0.1h 5 Jun 2014)

            Sep 15, 2014 3:21:58 PM org.apache.coyote.AbstractProtocol init

            INFO: Initializing ProtocolHandler ["http-apr-8080"]

            Sep 15, 2014 3:21:58 PM org.apache.coyote.AbstractProtocol init

            INFO: Initializing ProtocolHandler ["ajp-apr-8009"]

            Sep 15, 2014 3:21:58 PM org.apache.catalina.startup.Catalina load

            INFO: Initialization processed in 1588 ms

            Sep 15, 2014 3:21:58 PM bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent

            INFO: Starting Bitronix Transaction Manager

            Sep 15, 2014 3:21:58 PM bitronix.tm.BitronixTransactionManager logVersion

            INFO: Bitronix Transaction Manager version 2.1.4

            Sep 15, 2014 3:21:58 PM bitronix.tm.Configuration buildServerIdArray

            WARNING: cannot get this JVM unique ID. Make sure it is configured and you only use ASCII characters. Will use IP address instead (unsafe for production usage!).

            Sep 15, 2014 3:21:58 PM bitronix.tm.Configuration buildServerIdArray

            INFO: JVM unique ID: <10.0.3.15>

            Sep 15, 2014 3:21:58 PM bitronix.tm.recovery.Recoverer run

            INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId '10.0.3.15')

            Sep 15, 2014 3:21:58 PM org.apache.catalina.core.StandardService startInternal

            INFO: Starting service Catalina

            Sep 15, 2014 3:21:58 PM org.apache.catalina.core.StandardEngine startInternal

            INFO: Starting Servlet Engine: Apache Tomcat/7.0.55

            Sep 15, 2014 3:21:58 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\docs

            Sep 15, 2014 3:22:00 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\docs has finished in 1,266 ms

            Sep 15, 2014 3:22:00 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\examples

            Sep 15, 2014 3:22:00 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\examples has finished in 922 ms

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\host-manager

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\host-manager has finished in 235 ms

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\manager

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\manager has finished in 219 ms

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\ROOT

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\ROOT has finished in 281 ms

            Sep 15, 2014 3:22:01 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\XmlRESTService

            Sep 15, 2014 3:22:07 PM org.apache.catalina.core.NamingContextListener addResource

            WARNING: Failed to register in JMX: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: bitronix.tm.resource.ResourceFactory]

            Sep 15, 2014 3:22:07 PM org.springframework.web.context.ContextLoader initWebApplicationContext

            INFO: Root WebApplicationContext: initialization started

            Sep 15, 2014 3:22:07 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh

            INFO: Refreshing Root WebApplicationContext: startup date [Mon Sep 15 15:22:07 CST 2014]; root of context hierarchy

            Sep 15, 2014 3:22:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

            INFO: Loading XML bean definitions from URL [file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/spring/app-context.xml]

            Sep 15, 2014 3:22:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

            INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]

            Sep 15, 2014 3:22:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

            INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml]

            Sep 15, 2014 3:22:08 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons

            INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f4243f1: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,pocService,pocServiceBean]; root of factory hierarchy

            Sep 15, 2014 3:22:08 PM org.hibernate.annotations.common.Version <clinit>

            INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

            Sep 15, 2014 3:22:08 PM org.hibernate.Version logVersion

            INFO: HHH000412: Hibernate Core {4.2.12.Final}

            Sep 15, 2014 3:22:08 PM org.hibernate.cfg.Environment <clinit>

            INFO: HHH000206: hibernate.properties not found

            Sep 15, 2014 3:22:08 PM org.hibernate.cfg.Environment buildBytecodeProvider

            INFO: HHH000021: Bytecode provider name : javassist

            Sep 15, 2014 3:22:09 PM org.hibernate.cfg.Configuration addResource

            INFO: HHH000221: Reading mappings from resource: META-INF/JBPMorm.xml

            Sep 15, 2014 3:22:09 PM org.hibernate.ejb.Ejb3Configuration configure

            WARN: HHH000144: hibernate.connection.autocommit = false breaks the EJB3 specification

            Sep 15, 2014 3:22:09 PM org.springframework.beans.factory.support.DefaultListableBeanFactory destroySingletons

            INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f4243f1: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,pocService,pocServiceBean]; root of factory hierarchy

            Sep 15, 2014 3:22:09 PM org.springframework.web.context.support.XmlWebApplicationContext doClose

            INFO: Closing Root WebApplicationContext: startup date [Mon Sep 15 15:22:07 CST 2014]; root of context hierarchy

            Sep 15, 2014 3:22:09 PM org.springframework.web.context.support.XmlWebApplicationContext doClose

            WARNING: Exception thrown from ApplicationListener handling ContextClosedEvent

            org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'cxf': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:212)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

                at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:148)

                at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:86)

                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)

                at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1030)

                at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993)

                at org.apache.cxf.bus.spring.SpringBus.destroyBeans(SpringBus.java:100)

                at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:196)

                at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:178)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

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

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

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

                at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:300)

                at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:226)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442)

                at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1071)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:477)

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)

                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)

                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)

                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)

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

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

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                at java.lang.Thread.run(Thread.java:745)

             

            Sep 15, 2014 3:22:09 PM org.springframework.web.context.support.XmlWebApplicationContext doClose

            WARNING: Exception thrown from LifecycleProcessor on context close

            java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Sep 15 15:22:07 CST 2014]; root of context hierarchy

                at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350)

                at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1038)

                at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993)

                at org.apache.cxf.bus.spring.SpringBus.destroyBeans(SpringBus.java:100)

                at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:196)

                at org.apache.cxf.bus.CXFBusImpl.shutdown(CXFBusImpl.java:178)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

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

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

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

                at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:300)

                at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:226)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442)

                at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1071)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:477)

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)

                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)

                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)

                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)

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

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

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                at java.lang.Thread.run(Thread.java:745)

             

            Sep 15, 2014 3:22:09 PM org.springframework.beans.factory.support.DefaultListableBeanFactory destroySingletons

            INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f4243f1: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,pocService,pocServiceBean]; root of factory hierarchy

            Sep 15, 2014 3:22:09 PM org.springframework.web.context.ContextLoader initWebApplicationContext

            SEVERE: Context initialization failed

            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocService': Cannot resolve reference to bean 'pocServiceBean' while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocServiceBean' defined in URL [file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/spring/app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)

                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)

                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)

                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)

                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)

                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)

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

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

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                at java.lang.Thread.run(Thread.java:745)

            Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocServiceBean' defined in URL [file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/spring/app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

                ... 30 more

            Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)

                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)

                ... 38 more

            Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:924)

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899)

                at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:59)

                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)

                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)

                at com.fet.sdp.poc.bpm.BPMService.<init>(BPMService.java:79)

                at com.fet.sdp.poc.xmlrest.service.services.POCService.<init>(POCService.java:22)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

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

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

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

                at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

                ... 40 more

            Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [jdbc/testDS]

                at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)

                at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)

                at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)

                at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)

                at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)

                at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)

                at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)

                at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)

                at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)

                at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)

                at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1825)

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1783)

                at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)

                ... 51 more

            Caused by: javax.naming.NameNotFoundException: Name [jdbc/testDS] is not bound in this Context. Unable to find [jdbc].

                at org.apache.naming.NamingContext.lookup(NamingContext.java:819)

                at org.apache.naming.NamingContext.lookup(NamingContext.java:153)

                at org.apache.naming.SelectorContext.lookup(SelectorContext.java:133)

                at javax.naming.InitialContext.lookup(InitialContext.java:415)

                at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65)

                ... 64 more

             

            Sep 15, 2014 3:22:09 PM org.apache.catalina.core.StandardContext startInternal

            SEVERE: Error listenerStart

            Sep 15, 2014 3:22:09 PM org.apache.catalina.core.StandardContext startInternal

            SEVERE: Context [/XmlRESTService] startup failed due to previous errors

            Sep 15, 2014 3:22:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads

            SEVERE: The web application [/XmlRESTService] appears to have started a thread named [bitronix-task-scheduler] but has failed to stop it. This is very likely to create a memory leak.

            Sep 15, 2014 3:22:09 PM org.apache.catalina.startup.HostConfig deployDirectory

            INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\XmlRESTService has finished in 7,985 ms

            Sep 15, 2014 3:22:09 PM org.apache.coyote.AbstractProtocol start

            INFO: Starting ProtocolHandler ["http-apr-8080"]

            Sep 15, 2014 3:22:09 PM org.apache.coyote.AbstractProtocol start

            INFO: Starting ProtocolHandler ["ajp-apr-8009"]

            Sep 15, 2014 3:22:09 PM org.apache.catalina.startup.Catalina start

            INFO: Server startup in 11373 ms

            • 3. Re: [Need Help] PoolingDataSource() works only in standalong java code
              swiderski.maciej

              tomcat's JNDI tree does not bind objects directly ut via java:comp/env so you need to adjust your persistence.xml to look like this one.

               

              HTH

              • 4. Re: Re: [Need Help] PoolingDataSource() works only in standalong java code
                cyu021

                I think I need just one last kick to get my proof-of-concept to work on Tomcat (it works as standalone java program).

                Now I solve the JNDI and bitronix issue.

                Sep 15, 2014 7:55:08 PM bitronix.tm.recovery.Recoverer run

                INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 1 resource(s) [jdbc/testDS] (restricted to serverId 'tomcat-btm-node0')

                 

                But when it start to getKieBase, I got the "Cannot find a default KieBase" RuntimeException:

                INFO: Found kmodule: file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/META-INF/kmodule.xml

                Sep 15, 2014 7:55:22 PM org.drools.compiler.kie.builder.impl.KieRepositoryImpl addKieModule

                INFO: KieModule was added:FileKieModule[ ReleaseId=com.fet:com.fet.sdp.poc.xmlrest.service:1.0-SNAPSHOTfile=\apache-tomcat-7.0.55\webapps\XmlRESTService\WEB-INF\classes]

                Sep 15, 2014 7:55:22 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject discoverKieModules

                INFO: Found kmodule: file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/META-INF/kmodule.xml

                Sep 15, 2014 7:55:22 PM org.drools.compiler.kie.builder.impl.KieRepositoryImpl addKieModule

                INFO: KieModule was added:FileKieModule[ ReleaseId=com.fet:com.fet.sdp.poc.xmlrest.service:1.0-SNAPSHOTfile=\apache-tomcat-7.0.55\webapps\XmlRESTService\WEB-INF\classes]

                Sep 15, 2014 7:55:22 PM org.springframework.beans.factory.support.DefaultListableBeanFactory destroySingletons

                INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7f711d53: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,pocService,pocServiceBean]; root of factory hierarchy

                ...

                SEVERE: Context initialization failed

                org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocService': Cannot resolve reference to bean 'pocServiceBean' while setting bean property 'serviceBeans' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocServiceBean' defined in URL [file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/spring/app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is java.lang.RuntimeException: Cannot find a default KieBase

                    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

                    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

                    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)

                    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

                    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)

                    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)

                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)

                    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)

                    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

                    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

                    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)

                    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)

                    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

                    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

                    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)

                    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)

                    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)

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

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

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                    at java.lang.Thread.run(Thread.java:745)

                Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocServiceBean' defined in URL [file:/C:/apache-tomcat-7.0.55/webapps/XmlRESTService/WEB-INF/classes/spring/app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is java.lang.RuntimeException: Cannot find a default KieBase

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

                    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

                    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

                    ... 30 more

                Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.fet.sdp.poc.xmlrest.service.services.POCService]: Constructor threw exception; nested exception is java.lang.RuntimeException: Cannot find a default KieBase

                    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)

                    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)

                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)

                    ... 38 more

                Caused by: java.lang.RuntimeException: Cannot find a default KieBase

                    at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:244)

                    at com.fet.sdp.poc.bpm.BPMService01.<init>(BPMService01.java:122)

                    at com.fet.sdp.poc.xmlrest.service.services.POCService.<init>(POCService.java:24)

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

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

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

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

                    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

                    ... 40 more

                 

                my kmodule.xml has the content of:

                <?xml version="1.0" encoding="UTF-8"?>

                <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">

                    <kbase name="kb01">

                        <ksession name="ks01"/>

                    </kbase>

                </kmodule>

                 

                 

                 

                ====================== previous update ======================

                ok, I modified persistence.xml to

                <jta-data-source>java:comp/env/jdbc/testDS</jta-data-source>

                 

                and change [CATALINA_HOME\webapps\{MYAPP}\META-INF\context.xml] to

                <Context path="/dbtest">

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

                        factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/testDS" />

                    <Transaction factory="bitronix.tm.BitronixUserTransactionFactory" />

                </Context>

                 

                but now another exception pops out:

                Caused by: org.hibernate.HibernateException: Errors in named queries: GetProcessInstanceIdByCorrelation

                 

                my hibernate version is 4.2.12, all jar files related to hibernate are listed:

                hibernate-commons-annotations-4.0.2.Final.jar

                hibernate-core-4.2.12.Final.jar

                hibernate-entitymanager-4.2.12.Final.jar

                hibernate-jpa-2.0-api-1.0.1.Final.jar

                 

                 

                So I comment out the <named-query name="GetProcessInstanceIdByCorrelation"> block in JBPMorm.xml and startup Tomcat to see what will happen.

                Then I have following findings:

                 

                1.

                <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />

                in CATALINA_HOME\conf\server.xml causes exception:

                Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal

                Tomcat has the only bitronix instance and it tells me it cannot open disk journal ???

                 

                2.

                If I comment out

                <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />

                in CATALINA_HOME\conf\server.xml

                <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

                in CATALINA_HOME\conf\context.xml causes exception:

                Caused by: java.lang.RuntimeException: Cannot find a default KieBase