10 Replies Latest reply on Mar 12, 2009 3:47 PM by robro99

    MSSQL Exceptions

      I am trying to get jBPM running on MSSQL. I created my MSSQL DB using the jbpm.jpdl.mssql.sql script that came with the installation. I setup a datasource based on this guide. http://www.jboss.org/community/docs/DOC-12242 I have tried MS JDBC and jTDS with the same results. I am trying to run the Web Sale example. I get the following exceptions when it hits the timer associated with the evaluate web order task node.

      Is there any further data setup that is necessary beyond the SQL script provided with the installation? Has anyone else seen this or know of a guide on how to get jBPM running on MSSQL?

      2009-03-11 12:56:29,037 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.TimerEntityBean#findByPrimaryKey] Executing SQL: SELECT t0_TimerEntityBean.ID_ FROM JBPM_JOB t0_TimerEntityBean WHERE t0_TimerEntityBean.ID_=?
      2009-03-11 12:56:29,037 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@672bb3
      2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2009-03-11 12:56:29,067 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.TimerEntityBean#findByPrimaryKey] Find failed
      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: a226452:ab8:49b7ec92:5f 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: a226452:ab8:49b7ec92:5f status: ActionStatus.ABORT_ONLY >))
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:225)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:144)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.execute(JDBCFindByPrimaryKeyQuery.java:155)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:61)
      ... lots more ...

      for reference
      --
      jdk-6u12-windows-i586-p.exe
      jboss-4.2.3.GA-jdk6.zip
      jbpm-installer-3.3.1.GA.jar
      MSSQL 2005

      Also, for what it's worth, if I remove the timer I can run through all the nodes. However it then throws out a lot of exceptions on the console after I finish the last step where you enter a payment id.

        • 1. Re: MSSQL Exceptions

          When scouring the web I see a lot of talk about using XA datasources. Is this required for jBPM? The default installed hypersonic datasource appears to be <local-tx-datasource> and it works...

          • 2. Re: MSSQL Exceptions
            salaboy21

            If you are using one database/schema
            you must use local-tx and not XA datasources..
            Greetings!

            • 3. Re: MSSQL Exceptions

              I am using 1 DB with only 1 schema. Any idea what the exception I am getting means?

              I tried out an XA datasource (since I'm pretty much out of ideas) and it gave me the following exception when running web sale example.

              13:58:56,991 ERROR [EntitySchedulerService] failed to retrieve entity for Timer(Evaluate web order,2009-03-11 13:59:16,770,TaskInstance(Evaluate web order),Token(/))
              javax.ejb.ObjectNotFoundException: No such entity!
              at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:64)
              at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:604)

              • 4. Re: MSSQL Exceptions
                salaboy21

                Use Local-tx in your datasource file...

                • 5. Re: MSSQL Exceptions

                  I am. I only temporarily gave XA a try. Here is my DS.


                  <local-tx-datasource>
                  <jndi-name>MSSQLDS</jndi-name>
                  <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=jbpm</connection-url>
                  <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                  <user-name>sa</user-name>
                  password

                  <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

                  <type-mapping>MS SQLSERVER2000</type-mapping>

                  </local-tx-datasource>

                  • 6. Re: MSSQL Exceptions
                    salaboy21

                    standardjbosscmp-jdbc.xml
                    did you see that file?
                    and MS SQLSERVER2000 exists?

                    • 7. Re: MSSQL Exceptions

                      Yep it says to use SQLSERVER2000 for both 2000 and 2005. I can do some stuff with this connection. It just seems that the timer attached to that task node blows up.

                      • 8. Re: MSSQL Exceptions
                        salaboy21

                        I don't think that.. please post a new exception , and where this exception appears.. this is when you are starting jboss?

                        • 9. Re: MSSQL Exceptions

                          I start jboss, no errors. I open up jBPM. I start the websale example process. I enter my order data. I click OK. Then when it hits the timer associated with the evaluate order task node I get the following exception.

                          2009-03-11 12:56:29,037 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.TimerEntityBean#findByPrimaryKey] Executing SQL: SELECT t0_TimerEntityBean.ID_ FROM JBPM_JOB t0_TimerEntityBean WHERE t0_TimerEntityBean.ID_=?
                          2009-03-11 12:56:29,037 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@672bb3
                          2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
                          2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
                          2009-03-11 12:56:29,067 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
                          2009-03-11 12:56:29,067 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.TimerEntityBean#findByPrimaryKey] Find failed
                          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: a226452:ab8:49b7ec92:5f 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: a226452:ab8:49b7ec92:5f status: ActionStatus.ABORT_ONLY >))
                          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
                          at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:225)
                          at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:144)
                          at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.execute(JDBCFindByPrimaryKeyQuery.java:155)
                          at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:61)
                          ... lots more ...

                          • 10. Re: MSSQL Exceptions

                            In case anyone gets this error and cannot figure it out. Using the standard installers you will likely end up with 3 spots referencing your datasource. Unfortunately I was only updating 2 of them. I had missed jbosscmp-jdbc.xml, hence the reason using an XA datasource seemed to get me along further. Anyways with the standard install changing to a datasource named MSSQLDS I would recommend the following changes.

                            C:\jboss-4.2.3.GA\server\default\deploy\ejb-deployer.xml
                            change datasource from
                            jboss.jca:service=DataSourceBinding,name=DefaultDS
                            to
                            jboss.jca:service=DataSourceBinding,name=MSSQLDS

                            C:\jboss-4.2.3.GA\server\default\deploy\jbpm\jbpm-service.sar\hibernate.cfg.xml
                            change from
                            java:JbpmDS
                            to
                            java:MSSQLDS
                            also change from
                            org.hibernate.dialect.HSQLDialect
                            to
                            org.hibernate.dialect.SQLServerDialect


                            C:\jboss-4.2.3.GA\server\default\deploy\jbpm\jbpm-enterprise.jar\META-INF\jbosscmp-jdbc.xml
                            change from
                            java:/JbpmDS
                            to
                            java:/MSSQLDS