문제

I have installed successfully Drools KIE-WB with MYSQL (in Tomcat), and I want to achieve the same goal with the dashbuilder.

My dashbuilder package is jbpm-dashbuilder-6.1.0-SNAPSHOT-tomcat-7. And I have tested two different options:

The first tested option is:

Executing the file in tomcat-7.0.50\webapps\dashbuilder\WEB-INF\etc\sql\1-create-mysql.sql. It creates some tables, but seems that something is missed, because this error appears when starting the server:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dashboarddb.processinstancelog' doesn't exist

The second tested option is:

Change tomcat-7.0.50\webapps\dashbuilder\META-INF\context.xml to have the next datasource

<Resource name="jdbc/jbpm" auth="Container"
     type="javax.sql.DataSource" username="drools-user" password="pass"            driverClassName="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost:3306/dashboarddb?useUnicode=true&amp;characterEncoding=UTF8"
     maxActive="8"
     />

And in tomcat-7.0.50\webapps\dashbuilder\WEB-INF\etc\hibernate.cfg.xml I have added the next line:

<property name="hibernate.hbm2ddl.auto">update</property>

To force Hibernate to create all tables in MySQL. This almost work (create several tables) but an error appears:

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1-title-Dashboards Showcase' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    ...

And I have no idea how to fix it (because I have no information about what Hibernate is doing and creating).

I have no more ideas of how to install the dashboard using MySQL. Any clue about how to achieve it?

도움이 되었습니까?

해결책

The two webapps (Kie-wb and jBPM dashboard) must share the same database since the jBPM dashboard feeds from the jBPM history-log (more details here https://github.com/droolsjbpm/jbpm-dashboard/tree/master/jbpm-dashboard-distributions/src/main/tomcat7).

So you first need to deploy and run kie-wb against a given data source. Let's say you named it "kie-wb". Once you have kie-wb running (tables created on DB) you can proceed deploying jbpm-dashboard, which must be configured to connect against the same "kie-wb" datasource.

DON'T enable auto ddl update as it's not recommended in production. You can either run the script 1-create-mysql.sql prior to the app. deployment or just let the app run it on start up (auto running the script it's actually done by the app itself if it doesn't detect some required tables).

If you follow the steps above everything should be working fine. Otherwise, don't hesitate to ask again.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top