8 Replies Latest reply on Jan 21, 2009 10:52 AM by kukeltje

    Error setup with both MySQL and Hypersonic

    fgeorges

      Hi,

      I try to install jBPM on Windows. I tried with Hypersonic and
      MySQL, and experienced problems with both. I downloaded the install
      file jbpm-installer-3.3.0.GA.jar and executed the procedure (with
      optional features.) That installed a JBoss server. With MySQL, I get
      the following errors when starting this server:

      2008-12-24 13:07:00,661 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.NullPointerException)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:144)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
       ...
      Caused by: java.lang.NullPointerException
       at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.wrapConnection(MysqlXADataSource.java:68)
       at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.getXAConnection(MysqlXADataSource.java:60)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:136)
       ... 125 more
      


      I've installed MySQL with all default values with the install file
      for Windows freshly downloaded from their website.

      When I install jBPM with Hypersonic instead, I can start the server
      without problem, I log in, I go to the websale process, I start a new
      instance, I click examine, I fill in the form and I click "Evaluate"
      to get to the next step. And there I get an error, see the screenshot
      at: http://www.fgeorges.org/tmp/jbpm-hypersonic-evaluate-bug.jpg (the
      exception message is "Error completing task: An exception of type
      "org.jbpm.graph.def.DelegationException" was thrown. The message is:
      Cannot open connection".)

      2008-12-24 13:32:49,365 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void org.jbpm.ejb.LocalTimerEntity.createTimer(org.jbpm.job.Timer), causedBy:
      java.lang.IllegalStateException: Unable to persist timer
       at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:124)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       ...
      Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -53e57f88:74a:49522af4:63 status: ActionStatus.ABORT_ONLY>); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -53e57f88:74a:49522af4:63 status: ActionStatus.ABORT_ONLY >))
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.insertTimer(GeneralPurposeDatabasePersistencePlugin.java:199)
       at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:120)
       ... 112 more
      Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -53e57f88:74a:49522af4:63 status: ActionStatus.ABORT_ONLY>)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 114 more
      Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -53e57f88:74a:49522af4:63 status: ActionStatus.ABORT_ONLY >
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:744)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:577)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
       ... 118 more
      


      Both log files are available at:

      - http://www.fgeorges.org/tmp/jbpm-with-mysql--server.log
      - http://www.fgeorges.org/tmp/jbpm-with-hypersonic--server.log

      Do you have any idea on what's going wrong?

      Best regards, and merry Xmas,

      --
      Florent Georges
      http://www.fgeorges.org/


        • 1. Re: Error setup with both MySQL and Hypersonic
          fgeorges

           

          When I install jBPM with Hypersonic instead, I can start the server
          without problem, I log in, I go to the websale process, I start a new
          instance, I click examine, I fill in the form and I click "Evaluate"
          to get to the next step. And there I get an error, see the screenshot
          at: http://www.fgeorges.org/tmp/jbpm-hypersonic-evaluate-bug.jpg (the
          exception message is "Error completing task: An exception of type
          "org.jbpm.graph.def.DelegationException" was thrown. The message is:
          Cannot open connection".)


          I have the exact same problem on Mac OS X.

          --
          Florent Georges
          http://www.fgeorges.org/



          • 2. Re: Error setup with both MySQL and Hypersonic
            kukeltje

            is your -ds.xml file configured correctly?

            • 3. Re: Error setup with both MySQL and Hypersonic
              dthibau1

              I have exactly the same error and as Florent I started to install with MySQL then go back to HSQL.

              I had to edit hibernate.cfg.xml to change the dialect to org.hibernate.dialect.HSQLDialect

              and my -ds.xml is as follows :

              <?xml version="1.0" encoding="UTF-8"?>
              <datasources>
              
               <local-tx-datasource>
               <jndi-name>JbpmDS</jndi-name>
              
               <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}jbpmDB</connection-url>
               <driver-class>org.hsqldb.jdbcDriver</driver-class>
               <user-name>sa</user-name>
               <password></password>
              
               <!-- connection pool parameters -->
               <min-pool-size>1</min-pool-size>
               <max-pool-size>5</max-pool-size>
              
               <!-- disable idle connection removal, hsqldb does not reap threads on closed connections -->
               <idle-timeout-minutes>0</idle-timeout-minutes>
               <!-- check all statements are closed when the connection is returned to the pool -->
               <track-statements />
               <!-- hsqldb benefits from prepared statement caching -->
               <prepared-statement-cache-size>32</prepared-statement-cache-size>
              
               <!-- corresponding type-mapping in conf/standardjbosscmp-jdbc.xml -->
               <metadata>
               <type-mapping>Hypersonic SQL</type-mapping>
               </metadata>
              
               <!-- ensure the datasource is not initialized before the database itself -->
               <depends>jboss:service=Hypersonic,database=jbpmDB</depends>
               </local-tx-datasource>
              
               <mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic,database=jbpmDB">
               <attribute name="Database">jbpmDB</attribute>
               <attribute name="InProcessMode">true</attribute>
               </mbean>
              
              </datasources>
              


              Anything else to do ?

              • 4. Re: Error setup with both MySQL and Hypersonic
                kukeltje

                Just FYI (normally I hate these ' I have the same problem' reports without any additional information), I have the same problem with jBPM (3.3.1.GA), MySQL 5.0.67, MySQL Connector 5.1.6, openJDK 6, with the XA configuration that comes with jBPM. If I go back to a non-xa config it works. I (but that is really personal) refuse from now on to use HSQLDB.

                Currently have no time to verify this, but feel free to file a jira issue for this.

                • 5. Re: Error setup with both MySQL and Hypersonic
                  dthibau1

                  I think, I found an explanation.

                  In fact, the exception is thrown because jbpm try to update two DBs in one transaction without xa-datasources.
                  jbpmDS is updated
                  and the EJBTimerBean (I don't know why !) try to update DefaultDS.


                  In the jmx-console, i have updated the MBean jboss.ejb:service=EJBTimerService,persistencePolicy=database in order to use jboss.jca:service=DataSourceBinding,name=JbpmDS instead of jboss.jca:service=DataSourceBinding,name=DefaultDS

                  I stop then restart the MBean and I was able to activate the 'Evaluate' button.

                  But, i'have still a question. In which file, we configure the DS for the EJB Timer Bean ??

                  Thanks in advance

                  • 6. Re: Error setup with both MySQL and Hypersonic
                    dthibau1

                    See deploy/ejb-deployer.xml to configure datasource used by EJBTimer

                    • 7. Re: Error setup with both MySQL and Hypersonic
                      heiko.braun

                      For mysql datasources:

                      Take a look at server/default/deploy/jbpm/jbpm-mysql-ds.xml.
                      I think the installer doesn't substitute the connection properties.
                      It should contain something like this:

                      [...]
                      <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                       <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/jbpmtest</xa-datasource-property>
                       <user-name>jbpmtest</user-name>
                       <password></password>
                      [...]
                      


                      • 8. Re: Error setup with both MySQL and Hypersonic
                        kukeltje

                        Yes that is one thing (should be a jira issue for this afaik), but I had changed that manually. My problem originated in the use of the mysql 5.1.6 driver, the 5.1.7 driver does not have that problem