Red Hat has a fully supported, certified, enterprise BRMS product, which contain jBPM, BRMS 5.3.x build from jBPM 5.2.x source code, so it's meaningful and necessary to dive into jBPM 5.2.x source code. This is article give a solution of how remote debug jbpm-gwt-console-server source code with Eclipse and JBoss(JBoss EAP 5.1).
Clone and build jBPM 5.2.x source code
- clone
git clone -b 5.2.x git@github.com:droolsjbpm/jbpm.git
This will generate jbpm folder in your local Disk, which contain jBPM 5.2.x source code
- build
mvn clean install -Dmaven.test.skip=true
This will build whole jBPM5.2.x source code. jbpm-gwt-console-server-5.2.6-SNAPSHOT.war will be generated under jbpm/jbpm-gwt/jbpm-gwt-console-server/target.
- unzip
unzip jbpm-gwt-console-server-5.2.6-SNAPSHOT.war -d jbpm-gwt-console-server-5.2.6.war
This will generate jbpm-gwt-console-server-5.2.6.war folder, we will copy this folder to JBoss EAP 5.1 deployment folder for deploying jbpm-gwt-console-server
Deploy `jbpm-gwt-console-server-5.2.6.war` to JBoss EAP 5.1
- remove 4 hibernate jars, `hibernate-annotations-3.4.0.GA.jar`,`hibernate-commons-annotations-3.1.0.GA.jar`,`hibernate-core-3.3.2.GA.jar`,`hibernate-entitymanager-3.4.0.GA.jar ` from jbpm-gwt-console-server-5.2.6.war/WEB-INF/lib
- create `ExtraIndexes.hbm.xml` file under jbpm-gwt-console-server-5.2.6.war/WEB-INF/classes/META-INF with content:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > <hibernate-mapping package="org.jbpm.persistence.processinstance"> <database-object> <create>CREATE INDEX IDX_EVENTTYPES ON EVENTTYPES (INSTANCEID);</create> <drop /> <dialect-scope name="org.hibernate.dialect.DB2Dialect" /> <dialect-scope name="org.hibernate.dialect.MySQL5Dialect" /> <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect" /> <dialect-scope name="org.hibernate.dialect.Oracle9Dialect" /> <dialect-scope name="org.hibernate.dialect.OracleDialect" /> <dialect-scope name="org.hibernate.dialect.PostgreSQLDialect" /> <dialect-scope name="org.hibernate.dialect.SQLServerDialect" /> </database-object> </hibernate-mapping>
- remove `ejb3-persistence-1.0.2.GA.jar`,`log4j-1.2.14.jar`,`xml-apis-1.3.04.jar`,`slf4j-log4j12-1.6.0.jar`,`slf4j-api-1.6.0.jar` from jbpm-gwt-console-server-5.2.6.war/WEB-INF/lib
- copy jbpm-gwt-console-server-5.2.6.war to JBoss EAP 5 deployment folder
Execute remote debug
- start JBoss with below JVM OPT enable
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
- import jbpm-gwt-console-server referred source code to eclipse to execute debug
Comments