Install Problems with jbpm/MySQL
lyallp Nov 19, 2008 12:41 AMI am having problems with getting jbpm working.
eclipse-jee-ganymede-SR1-win32.zip
jboss-4.2.3.GA.zip
jbpm-installer-3.3.0.GA.jar
jbpm-jpdl-designer-suite-3.1.5.zip
jdk-6u5-windows-i586-p.exe
mysql-5.0.67-win32.exe
mysql-connector-java-3.1.14.zip
OS = Windows 2003 Server SP2 (x86 32 bit)
MySQL on same server in C:/jboss-4.2.3.GA
I copied the mysql-connector-java-3.1.14-bin.jar into c:/jboss-4.2.3.GA/server/default/lib/
I have updated c:/jboss-4.2.3.GA/server/default/conf/login-config.xml
<application-policy name = "MySqlDbRealm"> <authentication> <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">jboss</module-option> <module-option name = "userName">jboss</module-option> <module-option name = "password">password</module-option> <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option> </login-module> </authentication> </application-policy>
I have created c:/jboss-4.2.3.GA/server/default/deploy/mysql-default-ds.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- $Id: mysql-ds.xml 71535 2008-04-01 07:05:03Z adrian@jboss.org $ --> <!-- Datasource config for MySQL using 3.0.9 available from: http://www.mysql.com/downloads/api-jdbc-stable.html --> <datasources> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>jboss</user-name> <password>password</password> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> <!-- should only be used on drivers after 3.22.1 with "ping" support --> <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
I copied c:/jboss-4.2.3.GA/docs/examples/jms/mysql-jdbc2-service.xml
to c:/jboss-4.2.3.GA/server/default/deploy/jms/mysql-jdbc2-service.xml
and updated with the following fragment (updated name=DefaultDS)
<mbean code="org.jboss.mq.pm.jdbc2.PersistenceManager" name="jboss.mq:service=PersistenceManager"> <depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
I then created a database in MySQL called 'jbossdb' and a user 'jboss' which has full control over the 'jbossdb' database.
I boot jBoss and the jms tables appeared and everything appeares to operate correctly.
I then shutdown jBoss and then install 'jbpm' using jboss-4.2.3.GA
I install into c:/jbpm-3.3.0.GA
* point it at C:/jboss-4.2.3.GA
* use MySQL
I then created a database in MySQL called 'jbpmdb' and a user 'jbpm' which has full control over all databases (in my desparation)
I then edit c:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?> <datasources> <xa-datasource> <jndi-name>JbpmDS</jndi-name> <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/jbpmdb</xa-datasource-property> <user-name>jbpm</user-name> <password>password</password> <!-- reduce isolation from the default level (repeatable read) --> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <!-- separate connections used with and without JTA transaction --> <no-tx-separate-pools /> <!-- disable transaction interleaving --> <track-connection-by-tx /> <!-- leverage mysql integration features --> <exception-sorter-class-name> com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter </exception-sorter-class-name> <valid-connection-checker-class-name> com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker </valid-connection-checker-class-name> <!-- corresponding type-mapping in conf/standardjbosscmp-jdbc.xml --> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </xa-datasource> </datasources>
I then copied c:/jbpm-3.3.0.GA/config/hibernate.cfg.mysql.xml into c:/jbpm-3.3.0.GA/config/hibernate.cfg.xml
and edited the following fragment
<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/jbpmdb</property> <property name="hibernate.connection.username">jbpm</property> <property name="hibernate.connection.password">Password1</property> <property name="hibernate.query.substitutions">true 1, false 0</property> <!-- JDBC connection properties (end) --> <!-- DataSource properties (begin) --> <property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property> <!-- DataSource properties (end) -->
I then copied this into C:\jboss-4.2.3.GA\server\default\deploy\jbpm\jbpm-service.sar\hibernate.cfg.xml
When I boot JBOSS, the following diagnostics are generated..
--- Incompletely deployed packages --- org.jboss.deployment.DeploymentInfo@8ebe4553 { url=file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/ } deployer: MBeanProxyExt[jboss.web:service=WebServer] status: Deployment FAILED reason: URL file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/ deployment failed state: FAILED watch: file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/WEB-INF/web.xml altDD: null lastDeployed: 1227111755625 lastModified: 1227087751875 mbeans: org.jboss.deployment.DeploymentInfo@c3886145 { url=file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/ } deployer: org.jboss.deployment.EARDeployer@1b158db status: Deployment FAILED reason: URL file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/ deployment failed state: FAILED watch: file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/META-INF/application.xml altDD: null lastDeployed: 1227111755625 lastModified: 1227087751562 mbeans: --- MBeans waiting for other MBeans --- ObjectName: jboss.j2ee:service=EjbModule,module=jbpm-enterprise-beans.jar State: FAILED Reason: org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException))) ObjectName: jboss.web.deployment:war=jsf-console.war,id=-1900133037 State: FAILED Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/ deployment failed --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: jboss.web.deployment:war=jsf-console.war,id=-1900133037 State: FAILED Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jsf-console.war/ deployment failed ObjectName: jboss.j2ee:service=EjbModule,module=jbpm-enterprise-beans.jar State: FAILED Reason: org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException)))
with more detailed logs from the first failure.
2008-11-20 02:52:36,000 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EjbModule,module=jbpm-enterprise-beans.jar 2008-11-20 02:52:36,000 DEBUG [org.jboss.ejb.EjbModule] Starting jboss.j2ee:service=EjbModule,module=jbpm-enterprise-beans.jar 2008-11-20 02:52:36,000 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TimerEntityBean] Initializing CMP plugin for TimerEntityBean 2008-11-20 02:52:36,015 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TimerEntityBean] Loading standardjbosscmp-jdbc.xml : file:/C:/jboss-4.2.3.GA/server/default/conf/standardjbosscmp-jdbc.xml 2008-11-20 02:52:36,312 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.TimerEntityBean] file:/C:/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-enterprise-bundle.ear/jbpm-enterprise-beans.jar/META-INF/jbosscmp-jdbc.xml found. Overriding defaults 2008-11-20 02:52:36,437 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: registering pool with interval 900000 old interval: 450000 2008-11-20 02:52:36,468 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true 2008-11-20 02:52:36,468 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false 2008-11-20 02:52:36,468 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true 2008-11-20 02:52:36,468 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.reflect.UndeclaredThrowableException) at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:155) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:575) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:172) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:157) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:435) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368) at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172) at org.jboss.ejb.EjbModule.startService(EjbModule.java:414) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ...
I edited a copy of C:\jbpm-3.3.0.GA\database\jbpm.jpdl.mysql.sql to put a ';' at the end of each line
then used 'mysql' to execute it, generating all the tables in the jbpmdb database.
This makes no difference.
I tried changing the password of the 'jbpm' user - instead of unable to connect, I then receive authorisation
failures, so this indicates, at least to me, that I am successfully connecting to MySQL but something is going wrong.
I use phpMyAdmin on a different server to administer MySQL, so I am quite confident that MySQL is ok.
Suggestions as to where I am going wrong would be greatly appreciated.
...Lyall