[jBPM] - Deployment error on JBoss 7.0.2
by Jean-François Houzard
Jean-François Houzard [https://community.jboss.org/people/jhouzard] created the discussion
"Deployment error on JBoss 7.0.2"
To view the discussion, visit: https://community.jboss.org/message/779563#779563
--------------------------------------------------------------
Hi! I'm trying to deploy my JBpm application on Jboss 7.0.2.
I have defined a persistence unit for both jbpm and my business entities.
I configured the Transaction Manager with Spring 3.1.3.
Everything works well on a Tomcat 7.0, but when I deploy on a Jboss 7.0.2 then I get a javax.persistence.PersistenceException.
To fix the error, I added the following element in my persistence unit: <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
but then I get another exception refering to my business entities:
[...]
Caused by: java.lang.IllegalArgumentException: Not an managed type: class eu.publications.ceres.persistence.domain.Registration
[...]
Do you have an idea why on tomcat everything works fine and on JBoss not?
What does JBoss behind the scene?
Thank you
persistence.xml:
<persistence-unit name="ceres2013.persistence.unit">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.max_fetch_depth" value="4" />
<property name="hibernate.hbm2ddl.auto" value="validate" />
</properties>
</persistence-unit>
applicationContext.xml:
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="ceres2013.persistence.unit" />
</bean>
StackTrace:
[...]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ceres2013.persistence.unit] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900) [hibernate-entitymanager-3.5.4-Final.jar:]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [hibernate-entitymanager-3.5.4-Final.jar:]
[...]
Caused by: org.hibernate.HibernateException: Errors in named queries: ProcessInstancesWaitingForEvent
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:437) [hibernate-core-3.5.4-Final.jar:]
[...]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779563#779563]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - ClassCastException in DynamicUtils when using JPAKnowledgeService.loadStatefulKnowledgeSession()
by Wooi Joe Chuah
Wooi Joe Chuah [https://community.jboss.org/people/joe.chuah] created the discussion
"ClassCastException in DynamicUtils when using JPAKnowledgeService.loadStatefulKnowledgeSession()"
To view the discussion, visit: https://community.jboss.org/message/779244#779244
--------------------------------------------------------------
Hi,
I've encountered the problem as stated above when using DynamicUtils to addDynamicSubProcess at the following line
ProcessEventSupport eventSupport = ((InternalProcessRuntime)((InternalKnowledgeRuntime)ksession).getProcessRuntime()).getProcessEventSupport();
The reason as far as I know is because the ksession returned from JPAKnowledgeService.loadStatefulKnowledgeSession() or newStatefulKnowledgeSession()
which is implemented using org.drools.persistence.jpa.KnowledgeStoreServiceImpl
returns the ksession as a CommandBasedStatefulKnowledgeSession object instance.
The CommandBasedStatefulKnowledgeSession does not implement InternalKnowledgeRuntime and hence we hit a class cast exception.
The same problem does not occur when using a ksession from the KnowledgeBuilder>KnowledgeBase>ksession.
Any idea if CommandBasedStatefulKnowledgeSession is going to implement InternalKnowledgeRuntime in the future or
there's gonna be a fix for using sessions which are loaded from DB? or is it a limitation
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/779244#779244]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS
by Thomas Setiabudi
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] modified the document:
"Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS"
To view the document, visit: https://community.jboss.org/docs/DOC-47975
--------------------------------------------------------------
*
#A_What_I_Am_Going_To_Do A. What I Am Going To Do
*
#B_The_Setup_Steps B. The Setup Steps
*
#C_Lets_Install_it C. Lets Install it
I have been using JBPM5.3 for some months and then I switch to JBPM5.4.
After I download JBPM5.4.Final full installer, I thought the DB Set up will be exactly the same with JBPM5.3 full installer https://community.jboss.org/docs/DOC-19221 https://community.jboss.org/wiki/SetUpJBPM53ToUseMSSQLServer2008
But I realized that some things has changed and at the time when I write this, the guide for changing Database in JBPM5.4 full installer is still outdated http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609
h1. A. What I Am Going To Do
1. I will change the Database setting of jbpm5.4 final full installer and point it to use MS SQL Server 2008
2. The Database driver used is jtds-1.2.4
3. Although it is possible to have separate database for Task and Process data, in this setup I will use only one Database for all the Task database tables and all the Process database tables.
4. I do this set up using Windows XP 64 Bit
5. apache ant version used is Apache Ant 1.8.4
6. jdk used is jdk 1.6 (set in Windows Environment variable as JAVA_HOME)
7. I use 7-zip to help me modify files inside a .war file
h1. B. The Setup Steps
1. JBPM5.4 final full installer comes with almost every needed component, except eclipse (optional). But I want the eclipse, so I download *eclipse-java-helios-SR2-win32-x86_64.zip* and put it into
*jbpm-installer\lib* folder
2. Because my OS is 64 bit version, I have to do a modification to the *build.xml* file found in *jbpm-installer* folder. So I changed this part
<!-- Download Eclipse -->
<condition property="download.type" value="win32">
<os family="windows" />
</condition>
to
<!-- Download Eclipse -->
<condition property="download.type" value="win32-x86_64">
<os family="windows" />
</condition>
3. Now its time to set up the Hibernate settings, mostly we will make changes to the hibernate dialect, lets open *jbpm-installer\db* folder.
4. I am not sure how each file is used here in jbpm5.4 since the official guide still reflect jbpm5.3 files, so here is what I do, I start with opening *jbpm-installer\db*\*jbpm-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
5. Then I open *jbpm-installer\db*\*jbpm-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
6. Lets continue, and open *jbpm-installer\db\task-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" />
<property name="hibernate.connection.username" value="myuser"/>
<property name="hibernate.connection.password" value="mypassword"/>
7. Open *jbpm-installer\db\task-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
8. Lets navigate to other file in other folder, lets open *jbpm-installer\task-service\resources\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" />
<property name="hibernate.connection.username" value="myuser"/>
<property name="hibernate.connection.password" value="mypassword"/>
9. Ok, lets dig into .war files in the lib folder, (I use 7-zip to help me modify files inside .war files), lets open *jbpm-installer\lib* folder
10. Open *jbpm-installer\lib\jbpm-gwt-console-server-5.4.0.Final-EE6.war\WEB-INF\classes\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.max_fetch_depth" value="3" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
11. Next, Open *jbpm-installer\lib\jbpm-human-task-war-5.4.0.Final-EE6.war\WEB-INF\classes\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
12. Allright, seems like we are done changing dialects, lets provide our jtds jar. put *jtds-1.2.4.jar* into *jbpm-installer\db\driver* folder
13. next, we need to provide an xml file that will be used by jboss AS to recognize our jtds later, so *Create* a file called *sqlserver_module.xml* and put it in *jbpm-installer\db* folder
The file content is:
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">
<resources>
<resource-root path="jtds-1.2.4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
14. Wondered how the ant build will recognize our sqlserver_module.xml later? Happens to me too at first, lets open *jbpm-installer\build.properties* file
Look at this section:
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
db.name=h2
db.driver.jar.name=${db.name}.jar
db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
lets comment out the h2 setting and make our own sqlserver setting like this:
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
#db.name=h2
#db.driver.jar.name=${db.name}.jar
#db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
#sqlserver
db.name=sqlserver
db.driver.module.prefix=net/sourceforge/jtds
db.driver.jar.name=jtds-1.2.4.jar
because or db.name is sqlserver, our sqlserver_module.xml will be recognized by the ant build later on.
If you really want to know the reason, open *jbpm-installer\build.xml* and look at this section
<copy file="db/${db.name}_module.xml" tofile="${db.driver.module.dir}/module.xml" />
15. ok, now lets deal with the jboss AS 7 standalone setting, open *jbpm-installer\standalone.xml*
we need to do two things here, modify data source and make jboss as recognize our jtds driver, so change this section:
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:h2:~/jbpm</connection-url>
<driver>h2</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>sa</user-name>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
to
<datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB</connection-url>
<driver>JTDS</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>myuser</user-name>
<password>mypassword</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="JTDS" module="net.sourceforge.jtds">
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
16. Phew, quite a lot files that we have configured. at this point you may want to copy and backup the whole *jbpm-installer* folder, just in case you missed some configuration and caused error in the installation process later, who knows, things like that can happen, so just to be safe...
h1. C. Lets Install it
1. use our windows cmd and go to jbpm-installer folder.
2. run "ant install.demo"
3. in my case, this happen, so after ant install.demo finished successfully, I need to go to
*jbpm-installer\jboss-as-7.1.1.Final\standalone\deployments\jbpm-human-task-war.war\WEB-INF\classes\META-INF\persistence.xml*
and modify it from
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
4. run "ant install.demo.db" to install our db files
5. run "ant start.human.task" to let it create the task tables in the database
6. stop that cmd (hint: ctrl+c and say Y)
5. run "ant start.jboss" to start the JBOSS AS server
6. Look at your database, and verify if dbo.Task table is still there.
7. Enjoy your JBPM5.4 with MS SQL Server 2008
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47975]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years
[jBPM] - Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS
by Thomas Setiabudi
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] modified the document:
"Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS"
To view the document, visit: https://community.jboss.org/docs/DOC-47975
--------------------------------------------------------------
*
#A_What_I_Am_Going_To_Do A. What I Am Going To Do
*
#B_The_Setup_Steps B. The Setup Steps
I have been using JBPM5.3 for some months and then I switch to JBPM5.4.
After I download JBPM5.4.Final full installer, I thought the DB Set up will be exactly the same with JBPM5.3 full installer https://community.jboss.org/docs/DOC-19221 https://community.jboss.org/wiki/SetUpJBPM53ToUseMSSQLServer2008
But I realized that some things has changed and at the time when I write this, the guide for changing Database in JBPM5.4 full installer is still outdated http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609
h1. A. What I Am Going To Do
1. I will change the Database setting of jbpm5.4 final full installer and point it to use MS SQL Server 2008
2. The Database driver used is jtds-1.2.4
3. Although it is possible to have separate database for Task and Process data, in this setup I will use only one Database for all the Task database tables and all the Process database tables.
4. I do this set up using Windows XP 64 Bit
5. apache ant version used is Apache Ant 1.8.4
6. jdk used is jdk 1.6 (set in Windows Environment variable as JAVA_HOME)
7. I use 7-zip to help me modify files inside a .war file
h1. B. The Setup Steps
1. JBPM5.4 final full installer comes with almost every needed component, except eclipse (optional). But I want the eclipse, so I download *eclipse-java-helios-SR2-win32-x86_64.zip* and put it into
*jbpm-installer\lib* folder
2. Because my OS is 64 bit version, I have to do a modification to the *build.xml* file found in *jbpm-installer* folder. So I changed this part
<!-- Download Eclipse -->
<condition property="download.type" value="win32">
<os family="windows" />
</condition>
to
<!-- Download Eclipse -->
<condition property="download.type" value="win32-x86_64">
<os family="windows" />
</condition>
3. Now its time to set up the Hibernate settings, mostly we will make changes to the hibernate dialect, lets open *jbpm-installer\db* folder.
4. I am not sure how each file is used here in jbpm5.4 since the official guide still reflect jbpm5.3 files, so here is what I do, I start with opening *jbpm-installer\db*\*jbpm-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
5. Then I open *jbpm-installer\db*\*jbpm-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
6. Lets continue, and open *jbpm-installer\db\task-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" />
<property name="hibernate.connection.username" value="myuser"/>
<property name="hibernate.connection.password" value="mypassword"/>
7. Open *jbpm-installer\db\task-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
8. Lets navigate to other file in other folder, lets open *jbpm-installer\task-service\resources\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" />
<property name="hibernate.connection.username" value="myuser"/>
<property name="hibernate.connection.password" value="mypassword"/>
9. Ok, lets dig into .war files in the lib folder, (I use 7-zip to help me modify files inside .war files), lets open *jbpm-installer\lib* folder
10. Open *jbpm-installer\lib\jbpm-gwt-console-server-5.4.0.Final-EE6.war\WEB-INF\classes\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.max_fetch_depth" value="3" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
11. Next, Open *jbpm-installer\lib\jbpm-human-task-war-5.4.0.Final-EE6.war\WEB-INF\classes\META-INF\persistence.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
12. Allright, seems like we are done changing dialects, lets provide our jtds jar. put *jtds-1.2.4.jar* into *jbpm-installer\db\driver* folder
13. next, we need to provide an xml file that will be used by jboss AS to recognize our jtds later, so *Create* a file called *sqlserver_module.xml* and put it in *jbpm-installer\db* folder
The file content is:
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">
<resources>
<resource-root path="jtds-1.2.4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
14. Wondered how the ant build will recognize our sqlserver_module.xml later? Happens to me too at first, lets open *jbpm-installer\build.properties* file
Look at this section:
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
db.name=h2
db.driver.jar.name=${db.name}.jar
db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
lets comment out the h2 setting and make our own sqlserver setting like this:
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
#db.name=h2
#db.driver.jar.name=${db.name}.jar
#db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
#sqlserver
db.name=sqlserver
db.driver.module.prefix=net/sourceforge/jtds
db.driver.jar.name=jtds-1.2.4.jar
because or db.name is sqlserver, our sqlserver_module.xml will be recognized by the ant build later on.
If you really want to know the reason, open *jbpm-installer\build.xml* and look at this section
<copy file="db/${db.name}_module.xml" tofile="${db.driver.module.dir}/module.xml" />
15. ok, now lets deal with the jboss AS 7 standalone setting, open *jbpm-installer\standalone.xml*
we need to do two things here, modify data source and make jboss as recognize our jtds driver, so change this section:
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:h2:~/jbpm</connection-url>
<driver>h2</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>sa</user-name>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
to
<datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB</connection-url>
<driver>JTDS</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>myuser</user-name>
<password>mypassword</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="JTDS" module="net.sourceforge.jtds">
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
16. Phew, quite a lot files that we have configured. at this point you may want to copy and backup the whole *jbpm-installer* folder, just in case you missed some configuration and caused error in the installation process later, who knows, things like that can happen, so just to be safe...
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47975]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years
[jBPM] - Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS
by Thomas Setiabudi
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the document:
"Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS"
To view the document, visit: https://community.jboss.org/docs/DOC-47975
--------------------------------------------------------------
*
#A_What_I_Am_Going_To_Do A. What I Am Going To Do
*
#B_The_Setup_Steps B. The Setup Steps
I have been using JBPM5.3 for some months and then I switch to JBPM5.4.
After I download JBPM5.4.Final full installer, I thought the DB Set up will be exactly the same with JBPM5.3 full installer https://community.jboss.org/docs/DOC-19221 https://community.jboss.org/wiki/SetUpJBPM53ToUseMSSQLServer2008
But I realized that some things has changed and at the time when I write this, the guide for changing Database in JBPM5.4 full installer is still outdated http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609
h1. A. What I Am Going To Do
1. I will change the Database setting of jbpm5.4 final full installer and point it to use MS SQL Server 2008
2. The Database driver used is jtds-1.2.4
3. Although it is possible to have separate database for Task and Process data, in this setup I will use only one Database for all the Task database tables and all the Process database tables.
4. I do this set up using Windows XP 64 Bit
5. apache ant version used is Apache Ant 1.8.4
6. jdk used is jdk 1.6 (set in Windows Environment variable as JAVA_HOME)
h1. B. The Setup Steps
1. JBPM5.4 final full installer comes with almost every needed component, except eclipse (optional). But I want the eclipse, so I download *eclipse-java-helios-SR2-win32-x86_64.zip* and put it into
*jbpm-installer\lib* folder
2. Because my OS is 64 bit version, I have to do a modification to the *build.xml* file found in *jbpm-installer* folder. So I changed this part
<!-- Download Eclipse -->
<condition property="download.type" value="win32">
<os family="windows" />
</condition>
to
<!-- Download Eclipse -->
<condition property="download.type" value="win32-x86_64">
<os family="windows" />
</condition>
3. Now its time to set up the Hibernate settings, mostly we will make changes to the hibernate dialect, lets open *jbpm-installer\db* folder.
4. I am not sure how each file is used here in jbpm5.4 since the official guide still reflect jbpm5.3 files, so here is what I do, I start with opening *jbpm-installer\db*\*jbpm-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
5. Then I open *jbpm-installer\db*\*jbpm-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
6. Lets continue, and open *jbpm-installer\db\task-persistence-JPA1.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB" />
<property name="hibernate.connection.username" value="myuser"/>
<property name="hibernate.connection.password" value="mypassword"/>
7. Open *jbpm-installer\db\task-persistence-JPA2.xml*
I changed:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
to
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-47975]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years