[jboss-user] [JBoss jBPM] - Re: JBPM 3.2 on tomcat which uses mysql - LOGINI UNSUCCESSFU

ronninlee do-not-reply at jboss.com
Thu May 29 04:30:28 EDT 2008


"mputz" wrote : Please see below the necessary steps to get jBPM 3.2 working with Tomcat and MySQL.
  | 
  | Environment:
  | Tomcat 6.0.10
  | MySQL 5.0.15
  | jBPM 3.2.GA
  | 
  | 1. in jbpm-jpdl-3.2.GA/deploy run
  | ant customize.console.for.tomcat
  | 
  | 2. this builds a jbpm-console.war in jbpm-jpdl-3.2.GA/deploy/customized (almost) ready for deployment in TC
  | 
  | 3. change the jbpm-console.war/WEB-INF/classes/hibernate.cfg.xml to reflect the following changes:
  | 
  | <hibernate-configuration>
  |   |   <session-factory>
  |   | 
  |   |     <!-- hibernate dialect -->
  |   |     <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
  |   | 
  |   |     <!-- JDBC connection properties (begin) -->
  |   |     <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  |   |     <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm32</property>
  |   |     <property name="hibernate.connection.username">jbossjbpm</property>
  |   |     <property name="hibernate.connection.password">jbossjbpm</property>
  |   |      <!-- JDBC connection properties (end) -->
  |   |     
  |   |     <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
  |   |     
  |   |     <!-- DataSource properties (begin) ==
  |   |     <property name="hibernate.connection.datasource">java:/JbpmDS</property>
  |   |     == DataSource properties (end) -->
  |   |     <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
  |   | ...
  | 
  | (Make sure to use the hibernate.connection.driver/url attributes to connect to the db and not the hibernate.connection.datasource property. Also set hibernate.transaction.factory_class to JDBCTransactionFactory instead of the JTATransactionFactory or CMTTransactionFactory which are already in this file.)
  | 
  | 4. copy jboss-j2ee.jar (or maybe as well any jar that contains the default javax.transaction package) to jbpm-console.war/WEB-INF/lib. (Note: jboss-j2ee.jar can be found in a standard JBoss AS distribution)
  | 
  | 5. Copy the jar containing the mysql jdbc driver to /$CATALINA_HOME/lib
  | 
  | 6. Copy the adapted jbpm-console.war to /$CATALINA_HOME/webapps
  | 
  | Give it a try and start Tomcat. You should be able to start the jbpm web application, but for now you cannot successfully log in.
  | 
  | Next thing to do would be to properly configure your security realm. You could either go for the standard file based MemoryRealm and just add the jBPM specific users and roles to /$CATALINA_HOME/conf/tomcat-users.xml, OR...
  | 
  | Setup a JDBCRealm:
  | 
  | 7. create a file jbpm-console.xml in /$CATALINA_HOME/conf/Catalina/localhost similar to
  | <Context>
  |   | <Realm  className="org.apache.catalina.realm.JDBCRealm" 
  |   | 	driverName="com.mysql.jdbc.Driver"
  |   | 	connectionURL="jdbc:mysql://localhost:3306/jbpm32"
  |   | 	connectionName="jbossjbpm" 
  |   | 	connectionPassword="jbossjbpm"
  |   | 	userTable="JBPM_ID_USER" 
  |   | 	userNameCol="NAME_" 
  |   | 	userCredCol="PASSWORD_"
  |   | 	userRoleTable="JBPM_ID_MEMBERSHIP" 
  |   | 	roleNameCol="ROLE_" />
  |   | </Context>
  | 
  | 8. Adapt the jBPM user tables to fit in the Tomcat Realm specification. If you have the standard tables (JBPM_ID_USER, JBPM_ID_GROUP, JBPM_ID_MEMBERSHIP) with the default entries already, be sure that the the columns NAME_ and ROLE_ in JBPM_ID_MEMBERSHIP are not NULL. If so you could use the following SQL to update this table:
  | UPDATE jbpm_id_membership j, jbpm_id_user u
  |   | SET j.NAME_ = u.NAME_
  |   | WHERE j.USER_ = u.ID_
  |   | 
  |   | UPDATE jbpm_id_membership j, jbpm_id_group g
  |   | SET j.ROLE_ = g.NAME_
  |   | WHERE j.GROUP_ = g.ID_
  | 
  | Now you should be able to run jBPM default web app in Tomcat and login with the username/password from the db.

Thank you!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154178#4154178

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154178



More information about the jboss-user mailing list