[jboss-user] [jBPM] - Re: persistence JBPM5.3 on tomcat with mysql

Ted Pan do-not-reply at jboss.com
Mon Nov 19 21:34:29 EST 2012


Ted Pan [https://community.jboss.org/people/ted.pan] created the discussion

"Re: persistence JBPM5.3 on tomcat with mysql"

To view the discussion, visit: https://community.jboss.org/message/777286#777286

--------------------------------------------------------------
hi Kehua,



there are some issues with your code


1. since you have declared the datasource in web.xm, in persistence.xml, you can use java:comp/env/jdbc/jbpm-ds, instead of jdbc/jbpm-ds, and you don't need to define the connection parameters( driver_class, username and so on) in the persistence.xml, since you are using data source from container.
  please see the attached persistence.xml for detailed information.


2. you can pre-create the database with schema for the persistence unit, org.jbpm.persistence.jpa. But if you want to create it or update it when the persistence unit is created at the first time( see persistence.xml for <property name="hibernate.hbm2ddl.auto" value="update" />), you need to disable the transaction in your TaskProcessServlet's init(), please see the attached TaskProcessServlet.java file.


3. you do not need to manually initial the dateasource, please see the TaskProcessServlet.java from line 71 to 86. those lines could be commentted out.


4. the default's port for Mina server is 9123, you use MinaTaskServer server = new MinaTaskServer(taskService); to create the mina server, then you should use the port 9123 in your JbpmAPIUtil.java. please see the attached JbpmAPIUtil.java


5. in HumanTaskStartupServlet.java. you don't need to start a h2 server there, so you don't need the h2.jar in your classpath.




please note, I use different database name and database username, you can adjust the btm-resources.proeprties.  and because the attached file size limitation, I remove hibernate jars from the lib folder, you should add them back if you want to run it.




in case if I did not list all the issues, I attached the whole server1 with libraries for you. you can do a comparison with your server1.






Ted
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/777286#777286]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121119/3ee4021e/attachment.html 


More information about the jboss-user mailing list