Deploying jBPM sample application (payraiseprocess application) to Tomcat – my experience with some tricky issues:
- Added the jar files (commons-fileupload.jar, commons-validator.jar, commons-digester.jar, jakarta-oro.jar) to jBPM application library (WEB-INF\lib) or to <jbpm-directory>\lib if you're going to perform a build (required after Hibernate mapping modification below). I got “Cannot find ActionMappings or ActionFormBeans collection” error when calling the jbpm application without these jar files.
- [In order to use MySQL instead of the built in HSQLDB] Added MySQL driver (Connector/J mysql-connector-java-3.0.16-stable-bin.jar or a recent one) to the application library (jbpm/WEB-INF/lib). I got “java.sql.SQLException: Communication link failure: Unexpected end of input stream” with an older version of Connector/J drive.
Then modified jbpm.properties (hibernate.*) to be as follows:
hibernate.query.substitutions true=1, false=0
- payraiseprocess.par shouldn't be “deployed” but rather the contents to be copied (not literally) to the jbpm schema (which got generated on the first run of jbpm application).
there's an ant task (from jBPM folks) that takes a jbpm.properties file (where it should read hibernate) and accommodates the variables/files in the par file (payraiseprocess.par) to their locations in the jbpm database.
- I was getting a “XML document structures must start and end within the same entity.” error. This was due to the truncated data stored in jbpm database (Hibernate used VARCHAR(255) instead of a blob to map). One should follow this solution to change hibernate mapping files – then do a rebuild. [thanks Karim for pointing it out].
The changes to the *.hbm.xml files are quite minor – here they are:
In core/src/java/org/jbpm/model/definition/impl/DelegationImpl.hbm.xml replace:
<property name=”configuration” type=”string” length=”4000″ />
<property name=”configuration” type=”text” length=”65535″ />
In core/src/java/org/jbpm/model/definition/impl/FileImpl.hbm.xml replace
<property name=”bytes” type=”binary” />
<property name=”bytes” type=”binary” length=”65535″ />
(Don't forget to rebuild – then redeploy the process archive .par file once again)
That's about it… Now for the real work, discovering jBPM.