JBoss Community

Re: persistence JBPM5.3 on tomcat with mysql

created by Ted Pan in jBPM - View the full discussion

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

 

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

Start a new discussion in jBPM at Community