6 Replies Latest reply on Apr 16, 2010 11:14 AM by ricardo delarosa

    What is the data source where the DB table named JBPM_PROCESSDEFINITION is created ?

    ricardo delarosa Newbie

      Hello,

       

      I would like to know what is the name of the data source where table named JBPM_PROCESSDEFINITION is created ?
      Or where can I configure this data source ?

       

      I need this name, because when I tried to deploy a process with the code:

       

      --- beginning code ---
      repositoryService = processEngine.getRepositoryService();
      newDeployment = repositoryService.createDeployment() ;
      newDeployment = newDeployment.addResourceFromClasspath( nomDescriptorProceso );
      idDeploy = newDeployment.deploy() ;  /* ManejadorJBPM4.java:474 */
      --- ending code ---

       

      In the last line the next exception is thrown:

       

      --- beginning exception ---
      2010-04-13 15:29:35,000 DEBUG [org.hibernate.util.JDBCExceptionReporter] (http-127.0.0.1-8090-1) Cannot open connection [???]
      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: -7ffefa3a:74b:4bc4d384:8c 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: -7ffefa3a:74b:4bc4d384:8c status: ActionStatus.ABORT_ONLY >))
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
          at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
          at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
          at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
          at org.hibernate.loader.Loader.doQuery(Loader.java:696)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
          at org.hibernate.loader.Loader.doList(Loader.java:2228)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
          at org.hibernate.loader.Loader.list(Loader.java:2120)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
          at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:23)
          at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:10)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
          at org.jbpm.pvm.internal.id.DatabaseDbidGenerator.acquireDbidBlock(DatabaseDbidGenerator.java:76)
          at org.jbpm.pvm.internal.id.DatabaseDbidGenerator.getNextId(DatabaseDbidGenerator.java:63)
          at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:56)
          at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)
          at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
          at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
          at org.jbpm.pvm.internal.repository.DeploymentImpl.deploy(DeploymentImpl.java:91)
          at supercadejbpm.ManejadorJBPM4.registrarProceso(ManejadorJBPM4.java:474)
      --- ending exception --- 

       

      And I think that this exception is due to this data source is not properly defined. Am I wrong ? 

       

      I have defined a file named jbpm-ds.xml.
      I put this file in the "deploy" folder of jBoss v5.0.1.
      The contents of this file are:

       

      <datasources>
         <local-tx-datasource>
            <jndi-name>JbpmDS</jndi-name>
            <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:xe</connection-url>
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <user-name>BPM</user-name>
            <password>BPM</password>
            <min-pool-size>1</min-pool-size>
            <max-pool-size>5</max-pool-size>
            <idle-timeout-minutes>0</idle-timeout-minutes>
            <track-statements/>
            <prepared-statement-cache-size>32</prepared-statement-cache-size>
         </local-tx-datasource>
      </datasources>

      ____

       

      Besides I defined a file named "jbpm-oracle-ds.xml".
      I put this file in the "deploy/jbpm" folder of jBoss:

      <datasources>
        <xa-datasource>
          <jndi-name>XAJbpmDS</jndi-name>
          <track-connection-by-tx/>   

       

          <isSameRM-override-value>false</isSameRM-override-value>
          <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
          <xa-datasource-property name="URL">jdbc:oracle:thin:@127.0.0.1:1521:xe</xa-datasource-property>
          <xa-datasource-property name="User">BPM</xa-datasource-property>
          <xa-datasource-property name="Password">BPM</xa-datasource-property>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

       

          <no-tx-separate-pools/>
            <metadata>
               <type-mapping>Oracle9i</type-mapping>
            </metadata>
        </xa-datasource>

       

        <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
               name="jboss.jca:service=OracleXAExceptionFormatter">
          <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
        </mbean>

       

      </datasources>

      ____

       

      I addition, there is a file named "hsqldb-ds.xml" located on the directory "deploy".
      The contents of this file are: 

       

      <datasources>
         <local-tx-datasource>

       

            <jndi-name>DefaultDS</jndi-name>

       

            <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>

       

            <driver-class>org.hsqldb.jdbcDriver</driver-class>

       

            <user-name>sa</user-name>
            <password></password>

       

            <min-pool-size>5</min-pool-size>

       

            <max-pool-size>20</max-pool-size>

       

            <!-- The time before an unused connection is destroyed -->
            <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
            <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
            <idle-timeout-minutes>0</idle-timeout-minutes>

       

            <!-- 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
               <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
            -->

       

            <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
               <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
            -->

       

            <!-- Whether to check all statements are closed when the connection is returned to the pool,
                 this is a debugging feature that should be turned off in production -->
            <track-statements/>

       

            <!-- Use the getConnection(user, pw) for logins
              <application-managed-security/>

            -->

       

            <!-- Use the security domain defined in conf/login-config.xml -->
            <security-domain>HsqlDbRealm</security-domain>

       

            <!-- Use the security domain defined in conf/login-config.xml or the
                 getConnection(user, pw) for logins. The security domain takes precedence.
              <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
            -->

       

            <!-- HSQL DB benefits from prepared statement caching -->
            <prepared-statement-cache-size>32</prepared-statement-cache-size>

       

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

       

            <!-- When using in-process (standalone) mode -->
            <depends>jboss:service=Hypersonic,database=localDB</depends>
            <!-- Uncomment when using hsqldb in server mode
            <depends>jboss:service=Hypersonic</depends>
            -->
         </local-tx-datasource>

       

         <!-- Uncomment if you want hsqldb accessed over tcp (server mode)
         <mbean code="org.jboss.jdbc.HypersonicDatabase"
           name="jboss:service=Hypersonic">
           <attribute name="Port">       
              <value-factory bean="ServiceBindingManager" method="getIntBinding"
                 parameter="jboss:service=Hypersonic"/>
            </attribute>
           <attribute name="BindAddress">${jboss.bind.address}</attribute>    
           <attribute name="Silent">true</attribute>
           <attribute name="Database">default</attribute>
           <attribute name="Trace">false</attribute>
           <attribute name="No_system_exit">true</attribute>
         </mbean>
         -->

         <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
         <mbean code="org.jboss.jdbc.HypersonicDatabase"
           name="jboss:service=Hypersonic,database=localDB">
           <attribute name="Database">localDB</attribute>
           <attribute name="InProcessMode">true</attribute>
         </mbean>
        
      </datasources>
      _________________________

       

      I am using a jBoss v5.0.1. Application Server and jBPM 4.3

       

      Any help is sincerely appreciated.

       

      Ricardo