2 Replies Latest reply on Nov 6, 2015 5:31 PM by rajiv_dadhich

    Datasource error uniqueName 'jdbc/jbpm'  kie-drools-wb-distribution-wars-6.2.0.Final-tomcat7.war

    kambrave

      I have been follow :

      Installation notes

      ==================

       

       

      1. Install bitronix transaction manager into your tomcat 7

      - copy following libs into TOMCAT_HOME/lib

          * btm-2.1.4.jar

          * btm-tomcat55-lifecycle-2.1.4.jar

          * h2-1.3.161.jar

          * jta-1.1.jar

          * slf4j-api-1.7.2.jar

          * slf4j-jdk14-1.7.2.jar

       

          NOTE: versions of the libraries can be different as these are the actual on the time of writing.

       

      2. Create configuration files inside TOMCAT_HOME/conf

          * btm-config.properties

          ************************ sample 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

       

          *******************************************************************************

       

       

          * resources.properties

          ************************ sample resources.properties **************************

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

               resource.ds1.uniqueName=jdbc/jbpm

               resource.ds1.minPoolSize=10

               resource.ds1.maxPoolSize=20

               resource.ds1.driverProperties.driverClassName=org.h2.Driver

               resource.ds1.driverProperties.url=jdbc:h2:file:~/jbpm

               resource.ds1.driverProperties.user=sa

               resource.ds1.driverProperties.password=

               resource.ds1.allowLocalTransactions=true

          *******************************************************************************

       

          NOTE: jdbc/jbpm is the JNDI name used by tomcat distribution of the application

       

      3. Define system properties for btm.root, bitronix config file, JBoss logging provider and others.

       

          create setenv.sh (or setenv.bat) file inside TOMCAT_HOME/bin and add following:

       

          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 \

          -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-drools-wb/WEB-INF/classes/login.config \

          -Dorg.jboss.logging.provider=jdk"

       

          NOTE: this is an example for unix like systems for Windows $CATALINA_HOME needs to be replaced with windows env variable or absolute path

          NOTE: java.security.auth.login.config value includes name of the folder in which application is deployed by default it assumes kie-drools-wb so ensure that matches real installation.

          login.config file can be externalized as well meaning be placed outside of war file.

       

       

         *******************************************************************************

       

      4. Configure JEE security for kie-wb on tomcat (with default realm backed by tomcat-users.xml)

       

         2a. Copy "kie-tomcat-integration" JAR into TOMCAT_HOME/lib (org.kie:kie-tomcat-integration)

         2b. Copy "JACC" JAR into TOMCAT_HOME/lib (javax.security.jacc:artifactId=javax.security.jacc-api in JBoss Maven Repository)

         2c. Copy "slf4j-api" JAR into TOMCAT_HOME/lib (org.slf4j:artifactId=slf4j-api in JBoss Maven Repository)

         2d. Add valve configuration into TOMCAT_HOME/conf/server.xml inside Host element as last valve definition:

       

            <Valve className="org.kie.integration.tomcat.JACCValve" />

       

         2e. Edit TOMCAT_HOME/conf/tomcat-users.xml to include roles and users, make sure there will be 'analyst' or 'admin' roles defined as it's required to be authorized to use kie-wb

       

       

       

      ***********************************************************************************************************************

      Console erorrs output

      ===========================================================================

       

       

       

      Jun 05, 2015 3:53:24 PM org.hibernate.annotations.common.Version <clinit>

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

      Jun 05, 2015 3:53:24 PM org.hibernate.Version logVersion

      INFO: HHH000412: Hibernate Core {4.2.17.Final}

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Environment <clinit>

      INFO: HHH000206: hibernate.properties not found

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Environment buildBytecodeProvider

      INFO: HHH000021: Bytecode provider name : javassist

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Configuration addResource

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

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Configuration addResource

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

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Configuration addResource

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

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Configuration addResource

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

      Jun 05, 2015 3:53:24 PM org.hibernate.cfg.Configuration addResource

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

      Jun 05, 2015 3:53:25 PM org.kie.workbench.drools.backend.server.AppSetup assertPlayground

      SEVERE: Error during update config

      javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory

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

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

          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 org.jbpm.runtime.manager.impl.jpa.EntityManagerFactoryManager.getOrCreate(EntityManagerFactoryManager.java:49)

          at org.kie.workbench.drools.backend.server.BpmDependenciesProducer.getEntityManagerFactory(BpmDependenciesProducer.java:31)

          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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)

          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:164)

          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)

          at org.jboss.weld.bean.ProducerMethod$ProducerMethodProducer.produce(ProducerMethod.java:136)

          at org.jboss.weld.bean.AbstractProducerBean$AbstractProducer.produce(AbstractProducerBean.java:321)

          at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:310)

          at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68)

          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:626)

          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:692)

          at org.jboss.weld.injection.ParameterInjectionPoint.getValueToInject(ParameterInjectionPoint.java:120)

          at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:217)

          at org.jboss.weld.injection.MethodInjectionPoint.invoke(MethodInjectionPoint.java:111)

          at org.jboss.weld.util.Beans.callInitializers(Beans.java:817)

          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:806)

          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:165)

          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)

          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:161)

          at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:135)

          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:157)

          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:297)

          at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103)

          at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)

          at org.jbpm.services.cdi.impl.DeploymentServiceCDIImpl$Proxy$_$$_WeldClientProxy.getDeployedUnit(DeploymentServiceCDIImpl$Proxy$_$$_WeldClientProxy.java)

          at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.initDeployments(DeploymentManagerEntryPointImpl.java:108)

          at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.initDeployments(DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.java)

          at org.jbpm.console.ng.bd.backend.server.AdministrationServiceImpl.bootstrapDeployments(AdministrationServiceImpl.java:191)

          at org.jbpm.console.ng.bd.backend.server.AdministrationServiceImpl$Proxy$_$$_WeldClientProxy.bootstrapDeployments(AdministrationServiceImpl$Proxy$_$$_WeldClientProxy.java)

          at org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:190)

          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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)

          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:168)

          at org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:403)

          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:178)

          at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:298)

          at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103)

          at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)

          at org.kie.workbench.drools.backend.server.AppSetup$Proxy$_$$_WeldClientProxy.toString(AppSetup$Proxy$_$$_WeldClientProxy.java)

          at org.uberfire.backend.server.cdi.SystemConfigProducer.runPostConstruct(SystemConfigProducer.java:122)

          at org.uberfire.backend.server.cdi.SystemConfigProducer.afterDeploymentValidation(SystemConfigProducer.java:105)

          at org.uberfire.backend.server.cdi.SystemConfigProducer$Proxy$_$$_WeldClientProxy.afterDeploymentValidation(SystemConfigProducer$Proxy$_$$_WeldClientProxy.java)

          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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)

          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)

          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)

          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:164)

          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)

          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)

          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)

          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)

          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)

          at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)

          at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:46)

          at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:31)

          at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:382)

          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)

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

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

          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:652)

          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)

          at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)

          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.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:comp/env/jdbc/jbpm]

          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:1827)

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

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

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

          ... 93 more

      Caused by: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/jbpm', available resources: []

          at bitronix.tm.resource.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:55)

          at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)

          at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)

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

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

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

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

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

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

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

          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)

          ... 106 more

       

      Jun 05, 2015 3:53:31 PM org.jboss.resteasy.logging.impl.Slf4jLogger info

      INFO: Adding scanned @Provider: org.jboss.errai.security.client.local.interceptors.SecurityExceptionMapper

      Jun 05, 2015 3:53:31 PM org.jboss.resteasy.logging.impl.Slf4jLogger info

      - See more at: https://developer.jboss.org/message/932890#932890

        • 1. Re: Datasource error uniqueName 'jdbc/jbpm'  kie-drools-wb-distribution-wars-6.2.0.Final-tomcat7.war
          carlhuth

          The problem you have with it saying that jdbc/jbpm does not exist, tells me you did not get the Catalina Opts set.  Make sure that you are setting the runtime variables correctly to point to the btm-config.properties and you are setting the -Dbtm.root variable.  If you are running it via a service, you will need to 'configure' the arguments there.  Otherwise exporting the CATALINA_OPTS variable should resolve the issue.

          • 2. Re: Datasource error uniqueName 'jdbc/jbpm'  kie-drools-wb-distribution-wars-6.2.0.Final-tomcat7.war
            rajiv_dadhich

            Hi Kamal,

            If you are using jBPM as embedded within your application then you do need to do all bitronix related tomcat settings.

            Just make sure required jars are present in you application web-inf/lib. Also, ensure you have resources defined in your context.xml.

            <Resource driverClassName="oracle.jdbc.OracleDriver"

                    factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

                    name="jdbc/jbpm-ds" password="**" type="javax.sql.DataSource"

                    url="**"

                    username="**" />

                   

                <!--this is for default h2 <Resource name="jdbc/jbpm-ds" uniqueName="jdbc/jbpm-ds"

                    auth="Container" driverClassName="org.h2.Driver"

                    maxActive="20" maxIdle="10" maxWait="-1"

                    username="sa" password="" type="javax.sql.DataSource" url="**"/> -->

             

                <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"

                    factory="bitronix.tm.jndi.BitronixInitialContextFactory" />

             

            Thx.