Here are the required steps to get the jBPM5 console running in Tomcat6
1.) Copy the console war files provided in JBPM_INSTALLER/lib into Tomcat’s webapps directory
These war files can also be downloaded from (http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.0-CR1/jbpm-5.0-CR1-gwt-console.zip/download). This download has two war files jbpm-gwt-console-5.0-CR1.war and jbpm-gwt-console-server-5.0-CR1.war. Rename them to jbpm-console.war and gwt-console-server.war and copy them to TOMCAT_HOME/webapps
2.) Create users and roles in TOMCAT_HOME/conf/tomcat-users.xml.
Here is an example
<?xml version='1.0' encoding='utf-8'?>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="manager" password="manager" roles="manager"/>
<user username="krisv" password="krisv" roles="manager,admin,user"/>
<user username="john" password="john" roles="manager,admin,user"/>
<user username="mary" password="mary" roles="manager,admin,user"/>
3.) Set the jbpm.console.directory in Catalina.bat (.sh)
Here is an example.
.. -Djbpm.console.directory=C:/jbpm5/CR1/jbpm-installer/sample/evaluation/src/main/resources ..
4.) Copy JBPM_INSTALLER\jboss-4.2.3.GA server\default\data\birt into TOMCAT_HOME\birt. This will provide the reporting functionality
5.) Copy the database driver (e.g., h2.jar) and all the dependant jar files into TOMCAT_HOME/lib.
Here are the required libraries:
6.) Start database:
e.g, run ‘ant h2.start’ from JBPM_INSTALLER directory
7.) Start human task, e.g., run ‘ant start.human.task’ from JBPM_INSTALLER directory
This assumes that a datasource JNDI (jdbc/testDS1) is configured in Tomcat and a transaction manager (such as Bitronix or JOTM or Atomikos etc) is configured on Tomcat.
Refer to http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html for JNDI configuration on Tomcat6.
Login to console http://localhost:8080/jbpm-console (krisv/krisv)
All required jars including persistence jars as I've out in tomcat_home/lib folder but when i login to web-console ,while loading processes I get error-
" Could not initialize stateful knowledge session: javax/persistence/Persistence"
Infact I don't see any exception in server log and in humantask console window.
So it's related to testDS configuration and tranaction manager config for tomcat(i'm using tomcat 5.5)which is causing that exception.
So where do we need to put testDS and configuration about datasource JNDI (jdbc/testDS1)and transaction manager in server.xml file of tomcat?
I also did all setup for Tomcat but only issue is with setting up datasource JNDI and transaction manager.
I tried putting testDS in gwt-console-server.war web-inf folder ,then I added persistence related jars in Tomcat_Home/lib folder as well,but still same error I get related to finding persistence classes.
Could not initialize stateful knowledge session: No Persistence provider for EntityManager
Here is the snippet from server.xml config from Tomcat(below config is the second option I tried)
<Context path="/jbpm-console" docBase="C:/Anand/apache-tomcat-5.5.31/webapps/gwt-console-server.war"
debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" logAbandoned="true" removeAbandonedTimeout="60" removeAbandoned="true"
username="jana" password="jana" driverClassName="oracle.jdbc.OracleDriver"
I don't see any error on server log ,only while loading process in web console I get the exception.
So basically some configuration related to transactionManager and Datasource could be the problem.Let me know if any info on this.
If you are using Tomcat 5.5, you might want to follow these instructions
Also, what is the 'root cause' error shown at the end of stack trace?
It is mainly required to setup JNDI in Tomcat (jdbc/testDS1) and it depends on the transaction manager selected and Tomcat version.
For example, here is the documentation using Bitronix on Tomcat 6.
If this configured as global resource in Tomcat, no changes are required in the jbpm-console.war and gwt-console-server.war. The JNDI will be available globally for all the web applications
'I tried putting testDS in gwt-console-server.war web-inf folder ,then I added persistence related jars in Tomcat_Home/lib folder as well,but still same error I get related to finding persistence classes.'
Keeping the testDS in web-inf folder would not work with Tomcat. The context.xml file needs to be modified.
So here is my configuration on Tomcat 5.5.. and Oracle10 which I'm using .
<Host name="localhost" appBase="webapps"
<Context path="/jbpm-console" docBase="C:/Anand/apache-tomcat-5.5.31/webapps/gwt-console-server.war">
<Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
url="jdbc:oracle:thin:@localhost:1521:xe" username="jana" password="jana" maxActive="20" maxIdle="10" maxWait="-1" />
web.xml entry at gwt-console-server.war\WEB-INF\
Initially i was getting error while starting tomcat server-
So we have "persistence.xml" inside gwt-console-server.war\WEB-INF\classes\META-INF\ which has datasource(testDS1) entry.So Im not sure if we need to modify this file or not? I tried adding "context.xml" in META-INF with resource entry but that didn't help.
We need to tweak persistence.xml I belive to let Tomcat locate datasource and also persistemce.xml uses "org.hibernate.transaction.JBossTransactionManagerLookup" may be this lookup class should be changed.
Now after some changes to server.xml ,like change of "docBase" as above,I don't get any error on tomcat server but when I go to browser and enter
url (http://localhost:12000/jbpm-console/) then I get following message on the browser.
Let me know if you have any fix/suggestion for this.
Message on browser
GWT Console Server
You can find a list of resources here.
curl -u "user:password" -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions
curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definition/1/instances
Please post any questions to the gwt-console developer forum.
'We need to tweak persistence.xml I belive to let Tomcat locate datasource and also persistemce.xml uses "org.hibernate.transaction.JBossTransactionManagerLookup" may be this lookup class should be changed.
Let me know if you have any fix/suggestion for this.'
Which transaction manager you are using?
For example, if you are using Bitronix, you the set the value as follows in persistence.xml :
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
You also need to add the following libraries in Tomcat/lib if you are using Bitronix:
' I tried adding "context.xml" in META-INF with resource entry but that didn't help.'
This is not required if you define the Global datasource at the Tomcat level as all the web applications can access the JNDI.
I've not changed any setting for transaction manager.Whatever is there in jbpm persistence.xml I'm using the same,I tried using BTM transaction recently,so I'm able to see processes in web console but after entering username and submitting first form,it throws exception related to datasource /transaction related exception.But I believe I can make it work,if any issue then will post my queries.
If you have not changed lookupclass poperty in persistence.xml, you would get an exception as it assumes you are using Jboss transaction manager (see below), whereas you have configured Bitronix.
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />