7 Replies Latest reply on Sep 20, 2012 2:31 AM by Bujji Bujji

    NameNotFoundException - Jboss7, jbpm5.2 (update - for TransactionManager)

    Prasanth Manchambhatla Newbie

      From Jboss logs:

       

       

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "ojdbc6-11.1.0.7.0.jar"

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "drools-guvnor.war"

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "jbpm-gwt-console-server.war"

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "designer.war"

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Starting deployment of "jBpmHelloWorld.war"

      15:42:39,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "jbpm-gwt-console.war"

      15:42:40,720 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.1)

      15:42:40,724 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/jbpm-ds]

      15:42:44,598 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry iText-toolbox.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,598 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry iText-toolbox-2.1.2.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry bcmail-jdk14-138.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry bcprov-jdk14-138.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry activation.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/mail-1.4.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry xml-apis.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/serializer-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry xercesImpl.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,600 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry xml-apis.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

      15:42:44,600 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry serializer.jar in "/C:/noscan/jbpm-installer/content/jBpmHelloWorld.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

       

      ...........

      ...........

       

      16:15:15,112 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jBpmHelloWorld].[ping]] (http--0.0.0.0-8080-1) Servlet.service() for servlet ping threw exception: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) [hibernate-entitymanager-3.4.0.GA.jar:]

                at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) [hibernate-entitymanager-3.4.0.GA.jar:]

                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                at edu.apollogrp.platform.servlet.PingServlet.persistentFlow(PingServlet.java:55) [classes:]

                at edu.apollogrp.platform.servlet.PingServlet.doGet(PingServlet.java:38) [classes:]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

      Caused by: org.hibernate.HibernateException: Could not find datasource

                at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:79) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) [hibernate-entitymanager-3.4.0.GA.jar:]

                at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339) [hibernate-core-3.3.2.GA.jar:]

                at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) [hibernate-annotations-3.4.0.GA.jar:]

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) [hibernate-entitymanager-3.4.0.GA.jar:]

                ... 21 more

      Caused by: javax.naming.NameNotFoundException: unable to find a bound object at name 'java:jboss/datasources/jbpm-ds'

                at bitronix.tm.jndi.BitronixContext.lookup(BitronixContext.java:83) [btm-2.1.2.jar:]

                at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_26]

                at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75) [hibernate-core-3.3.2.GA.jar:]

                ... 29 more

       

       

      It says the datasource is bound, but, my application throws a NameNotFoundException.

        • 1. Re: NameNotFoundException - Jboss7, jbpm5.2
          Prasanth Manchambhatla Newbie

          Here is the configuration in standalone.xml file:

           

          <datasource jndi-name="java:jboss/datasources/jbpm-ds" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                              <connection-url>

                                  jdbc:oracle:thin:@localhost:1521:XE

                              </connection-url>

                              <driver>

                                  ojdbc6-11.1.0.7.0.jar

                              </driver>

                              <pool>

                                  <prefill>

                                      false

                                  </prefill>

                                  <use-strict-min>

                                      false

                                  </use-strict-min>

                                  <flush-strategy>

                                      FailingConnectionOnly

                                  </flush-strategy>

                              </pool>

                              <security>

                                  <user-name>

                                      jbpm

                                  </user-name>

                                  <password>

                                      xyz

                                  </password>

                              </security>

                          </datasource>

          • 2. Re: NameNotFoundException - Jboss7, jbpm5.2
            Prasanth Manchambhatla Newbie

            Here is the configuration in standalone.xml file:

             

            <datasource jndi-name="java:jboss/datasources/jbpm-ds" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                                <connection-url>

                                    jdbc:oracle:thin:@localhost:1521:XE

                                </connection-url>

                                <driver>

                                    ojdbc6-11.1.0.7.0.jar

                                </driver>

                                <pool>

                                    <prefill>

                                        false

                                    </prefill>

                                    <use-strict-min>

                                        false

                                    </use-strict-min>

                                    <flush-strategy>

                                        FailingConnectionOnly

                                    </flush-strategy>

                                </pool>

                                <security>

                                    <user-name>

                                        jbpm

                                    </user-name>

                                    <password>

                                        xyz

                                    </password>

                                </security>

                            </datasource>

            • 3. Re: NameNotFoundException - Jboss7, jbpm5.2
              Prasanth Manchambhatla Newbie

              [standalone@localhost:9999 /] /subsystem=datasources/data-source=java\:jboss\/datasources\/jbpm-ds:test-connection-in-pool

              {

                  "outcome" => "success",

                  "result" => [true]

              }

               

              This means datasource is registered correctly. Not sure why I get NameNotFoundException from my helloworld application.

              • 4. Re: NameNotFoundException - Jboss7, jbpm5.2
                Prasanth Manchambhatla Newbie

                Persistence.xml

                 

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

                <persistence version="1.0"

                             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

                                                 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd

                                                 http://java.sun.com/xml/ns/persistence/orm

                                                 http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"

                             xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"

                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                             xmlns="http://java.sun.com/xml/ns/persistence">

                 

                 

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

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

                    <jta-data-source>java:jboss/datasources/jbpm-ds</jta-data-source>

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

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

                    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                    <class>org.drools.persistence.info.SessionInfo</class>

                    <class>org.drools.persistence.info.WorkItemInfo</class>

                    <class>org.drools.persistence.info.SessionInfo</class>

                    <class>org.drools.persistence.info.WorkItemInfo</class>

                    <class>org.jbpm.process.audit.ProcessInstanceLog</class>

                    <class>org.jbpm.process.audit.NodeInstanceLog</class>

                    <class>org.jbpm.process.audit.VariableInstanceLog</class>

                    <class>org.jbpm.task.Attachment</class>

                    <class>org.jbpm.task.Content</class>

                    <class>org.jbpm.task.BooleanExpression</class>

                    <class>org.jbpm.task.Comment</class>

                    <class>org.jbpm.task.Deadline</class>

                    <class>org.jbpm.task.Comment</class>

                    <class>org.jbpm.task.Deadline</class>

                    <class>org.jbpm.task.Delegation</class>

                    <class>org.jbpm.task.Escalation</class>

                    <class>org.jbpm.task.Group</class>

                    <class>org.jbpm.task.I18NText</class>

                    <class>org.jbpm.task.Notification</class>

                    <class>org.jbpm.task.EmailNotification</class>

                    <class>org.jbpm.task.EmailNotificationHeader</class>

                    <class>org.jbpm.task.PeopleAssignments</class>

                    <class>org.jbpm.task.Reassignment</class>

                    <class>org.jbpm.task.Status</class>

                    <class>org.jbpm.task.Task</class>

                    <class>org.jbpm.task.TaskData</class>

                    <class>org.jbpm.task.SubTasksStrategy</class>

                    <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

                    <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

                    <class>org.jbpm.task.User</class>

                    <properties>

                      <property name="hibernate.max_fetch_depth" value="3"/>

                      <property name="hibernate.hbm2ddl.auto" value="update" />

                      <property name="hibernate.show_sql" value="false" />

                      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />

                      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

                    </properties>

                  </persistence-unit>

                </persistence>

                 

                 

                jndi.properties

                 

                java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFactory

                • 5. Re: NameNotFoundException - Jboss7, jbpm5.2
                  Prasanth Manchambhatla Newbie

                  Just getting rid of the jndi.properties file solved this issue, however, not AS7 is having problem finding the TransactionManager. I put JBossTransactionManagerLookup in persistence.xml but that did not help either. Removing the transaction manager lookup completely did not help either.

                   

                  Any pointers?

                  • 6. Re: NameNotFoundException - Jboss7, jbpm5.2
                    Prasanth Manchambhatla Newbie

                    This seemed to work.

                     

                    package com.jbpm.test;

                    public class MyTransactionManagerLookup extends JNDITransactionManagerLookup {

                        protected String getName() {

                            return "java:jboss/TransactionManager";

                        }

                        public String getUserTransactionName() {

                            return "UserTransaction";

                        }

                    }

                     

                    and modifying persistence.xml to

                     

                    <property name="hibernate.transaction.manager_lookup_class" value="com.jbpm.test.MyTransactionManagerLookup" />

                    • 7. Re: NameNotFoundException - Jboss7, jbpm5.2
                      Bujji Bujji Newbie

                      Prashanth,

                       

                      Please help us on the below issue. we are struggling with this from quite a long time.

                       

                       

                      We are working on JBPM 5.3 set up on Jboss AS 7.0.1. When we are opening jbpm console using the url http://localhost:8280/jbpm-console

                       

                      we are are getting org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS error.

                       

                       

                       

                      We have tried with custom transaction manager lookup as you suggested, but it is in vain. we are still getting the following problem.

                      org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS

                       

                      Here is the persistence.xml

                       

                      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                      <persistence version="1.0"
                                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                                                       http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
                                                       http://java.sun.com/xml/ns/persistence/orm
                                                       http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
                                   xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xmlns="http://java.sun.com/xml/ns/persistence">

                        
                      <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
                          
                      <provider>org.hibernate.ejb.HibernatePersistence</provider>
                           
                      <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
                          
                      <mapping-file>META-INF/JBPMorm.xml</mapping-file>
                          
                      <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>

                          
                      <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
                          
                      <class>org.drools.persistence.info.SessionInfo</class>
                          
                      <class>org.drools.persistence.info.WorkItemInfo</class>

                          
                      <class>org.jbpm.process.audit.ProcessInstanceLog</class>
                          
                      <class>org.jbpm.process.audit.NodeInstanceLog</class>
                          
                      <class>org.jbpm.process.audit.VariableInstanceLog</class>

                          
                      <properties>
                            
                      <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
                             <property name="hibernate.hbm2ddl.auto" value="create" />
                           
                             <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
                                     <property name="hibernate.connection.url" value="jdbc:mysql://127.0.0.1:3306/test" />
                                     <property name="hibernate.connection.username" value="root"/>
                                     <property name="hibernate.connection.password" value=""/>
                                     <property name="hibernate.connection.autocommit" value="false" />   -->
                      <!-- <property name="jta.UserTransaction" value = "java:jboss/TransactionManager"/> -->
                            
                      <!--  <property name="jta.data.source" value="java:jboss/datasources/jbpmDS"/> -->
                            
                      <!--  <property name="hibernate.max_fetch_depth" value="3"/>  -->
                            
                      <!-- hbm2ddl.auto MUST BE update! The console will otherwise overwrite the schema with each new thread -->
                           
                            
                      <property name="hibernate.show_sql" value="true" />

                            
                      <!-- for AS7 -->
                            
                      <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" />
                            
                      <!-- for AS5 -->
                            
                      <!-- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /> -->
                          
                      </properties>       
                        
                      </persistence-unit>
                          
                      </persistence>


                       

                       


                       

                      We can see the following trace on the Jboss AS console :

                       

                      11:02:34,919 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server].[Resteasy]] (http--127.0.0.1-8280-2) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.ExceptionInInitializerError

                                at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) [classes:]

                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                                at java.lang.Thread.run(Thread.java:680) [:1.6.0_33]

                      Caused by: java.lang.ExceptionInInitializerError

                                at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:131) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.SessionInitializer.<init>(SessionInitializer.java:25) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.TaskManagement.<init>(TaskManagement.java:51) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.ManagementFactory.createTaskManagement(ManagementFactory.java:26) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.ManagementFactory.createTaskManagement(ManagementFactory.java:19) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jboss.bpm.console.server.TaskListFacade.getTaskManagement(TaskListFacade.java:72) [classes:]

                                at org.jboss.bpm.console.server.TaskListFacade.getTasksForIdRef(TaskListFacade.java:101) [classes:]

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_33]

                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_33]

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_33]

                                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_33]

                                at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) [resteasy-jaxrs-2.2.1.GA.jar:]

                                at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) [resteasy-jaxrs-2.2.1.GA.jar:]

                                ... 24 more

                      Caused by: java.lang.RuntimeException: Could not initialize stateful knowledge session: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                                at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.initializeStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:163) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.StatefulKnowledgeSessionUtil$SessionHolder.<clinit>(StatefulKnowledgeSessionUtil.java:127) [jbpm-gwt-core-5.3.0.Final.jar:]

                                ... 40 more

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

                                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) [hibernate-entitymanager-3.4.0.GA.jar:]

                                at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) [hibernate-entitymanager-3.4.0.GA.jar:]

                                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                                at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.createOrLoadStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:263) [jbpm-gwt-core-5.3.0.Final.jar:]

                                at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.initializeStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:154) [jbpm-gwt-core-5.3.0.Final.jar:]

                                ... 41 more

                      Caused by: org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS

                                at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:98) [classes:]

                                at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) [hibernate-core-3.3.2.GA.jar:]

                                at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) [hibernate-entitymanager-3.4.0.GA.jar:]

                                at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) [hibernate-core-3.3.2.GA.jar:]

                                at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119) [hibernate-core-3.3.2.GA.jar:]

                                at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115) [hibernate-core-3.3.2.GA.jar:]

                                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339) [hibernate-core-3.3.2.GA.jar:]

                                at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) [hibernate-annotations-3.4.0.GA.jar:]

                                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) [

                      Prashanth,

                       

                      Please help us on the below issue. we are struggling with this from quite a long time.

                       

                       

                      We are working on JBPM 5.3 set up on Jboss AS 7.0.1. When we are opening jbpm console using the url http://localhost:8280/jbpm-console

                       

                      we are are getting org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS error.

                       

                       

                       

                      We have tried with custom transaction manager lookup as you suggested, but it is in vain. we are still getting the following problem.

                      org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS

                       

                      Here is the persistence.xml

                       

                      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                      <persistence version="1.0"
                                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                                                       http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
                                                       http://java.sun.com/xml/ns/persistence/orm
                                                       http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
                                   xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                   xmlns="http://java.sun.com/xml/ns/persistence">

                        
                      <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
                          
                      <provider>org.hibernate.ejb.HibernatePersistence</provider>
                           
                      <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
                          
                      <mapping-file>META-INF/JBPMorm.xml</mapping-file>
                          
                      <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>

                          
                      <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
                          
                      <class>org.drools.persistence.info.SessionInfo</class>
                          
                      <class>org.drools.persistence.info.WorkItemInfo</class>

                          
                      <class>org.jbpm.process.audit.ProcessInstanceLog</class>
                          
                      <class>org.jbpm.process.audit.NodeInstanceLog</class>
                          
                      <class>org.jbpm.process.audit.VariableInstanceLog</class>

                          
                      <properties>
                            
                      <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
                             <property name="hibernate.hbm2ddl.auto" value="create" />
                           
                             <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
                            <property name="hibernate.connection.url" value="jdbc:mysql://127.0.0.1:3306/test" />
                            <property name="hibernate.connection.username" value="root"/>
                            <property name="hibernate.connection.password" value=""/>
                            <property name="hibernate.connection.autocommit" value="false" />   -->
                      <!-- <property name="jta.UserTransaction" value = "java:jboss/TransactionManager"/> -->
                            
                      <!--  <property name="jta.data.source" value="java:jboss/datasources/jbpmDS"/> -->
                            
                      <!--  <property name="hibernate.max_fetch_depth" value="3"/>  -->
                            
                      <!-- hbm2ddl.auto MUST BE update! The console will otherwise overwrite the schema with each new thread -->
                           
                            
                      <property name="hibernate.show_sql" value="true" />

                            
                      <!-- for AS7 -->
                            
                      <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" />
                            
                      <!-- for AS5 -->
                            
                      <!-- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /> -->
                          
                      </properties>       
                        
                      </persistence-unit>
                          
                      </persistence>


                       

                       


                       

                      We can see the following trace on the Jboss AS console :

                       

                      11:02:34,919 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server].[Resteasy]] (http--127.0.0.1-8280-2) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.ExceptionInInitializerError

                        at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) [classes:]

                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                        at java.lang.Thread.run(Thread.java:680) [:1.6.0_33]

                      Caused by: java.lang.ExceptionInInitializerError

                        at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:131) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.SessionInitializer.<init>(SessionInitializer.java:25) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.TaskManagement.<init>(TaskManagement.java:51) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.ManagementFactory.createTaskManagement(ManagementFactory.java:26) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.ManagementFactory.createTaskManagement(ManagementFactory.java:19) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jboss.bpm.console.server.TaskListFacade.getTaskManagement(TaskListFacade.java:72) [classes:]

                        at org.jboss.bpm.console.server.TaskListFacade.getTasksForIdRef(TaskListFacade.java:101) [classes:]

                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_33]

                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_33]

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_33]

                        at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_33]

                        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) [resteasy-jaxrs-2.2.1.GA.jar:]

                        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) [resteasy-jaxrs-2.2.1.GA.jar:]

                        ... 24 more

                      Caused by: java.lang.RuntimeException: Could not initialize stateful knowledge session: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                        at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.initializeStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:163) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.StatefulKnowledgeSessionUtil$SessionHolder.<clinit>(StatefulKnowledgeSessionUtil.java:127) [jbpm-gwt-core-5.3.0.Final.jar:]

                        ... 40 more

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

                        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) [hibernate-entitymanager-3.4.0.GA.jar:]

                        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) [hibernate-entitymanager-3.4.0.GA.jar:]

                        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                        at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.createOrLoadStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:263) [jbpm-gwt-core-5.3.0.Final.jar:]

                        at org.jbpm.integration.console.StatefulKnowledgeSessionUtil.initializeStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:154) [jbpm-gwt-core-5.3.0.Final.jar:]

                        ... 41 more

                      Caused by: org.hibernate.HibernateException: Could not find datasource: java:jboss/datasources/jbpmDS

                        at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:98) [classes:]

                        at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) [hibernate-core-3.3.2.GA.jar:]

                        at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) [hibernate-entitymanager-3.4.0.GA.jar:]

                        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) [hibernate-core-3.3.2.GA.jar:]

                        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119) [hibernate-core-3.3.2.GA.jar:]

                        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115) [hibernate-core-3.3.2.GA.jar:]

                        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339) [hibernate-core-3.3.2.GA.jar:]

                        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) [hibernate-annotations-3.4.0.GA.jar:]

                        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) [hibernate-entitymanager-3.4.0.GA.jar:]

                        ... 46 more