3 Replies Latest reply on Feb 20, 2009 8:44 AM by Ronald van Kuijk

    where to set the database properties while installing jbpm-i

    santhosh samala Newbie

      when I execute jbpm-installer-3.3.1GA, the wizard will run and I give the location of jboss and also in one of the screen i say that iam using mysql , then the wizard executes completely creating jbpm folder in jboss4.2.2./server/default/deploy/

      when i open that newly created jbpm folder i am able to see a file called jbpm-mysql-ds.xml, it has three lines

      <xa-datasource-property name="URL">${jdbc.mysql.url}</xa-datasource-property>
       <user-name>${jdbc.mysql.username}</user-name>
       <password>${jdbc.mysql.password}</password>
      


      From where these three values will be configured, i couldnt find any file where i can configure these values, i have declared my self a file called mysql-ds.xml in deploy folder with following values

      <datasources>
       <local-tx-datasource>
       <jndi-name>JbpmDS</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/jbpm</connection-url>
       <!-- The driver class -->
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <!-- The login and password -->
       <user-name>root</user-name>
       <password>welcome</password>
       </local-tx-datasource>
      </datasources>


      but it gives me an error
      --- Incompletely deployed packages ---
      org.jboss.deployment.DeploymentInfo@ee96070 { url=file:/C:/jboss-4.2.2.GA/server/default/deploy/mysql-ds.xml }
       deployer: org.jboss.deployment.XSLSubDeployer@18f127c
       status: Deployment FAILED reason: Trying to install an already registered mbean: jboss.jca:service=DataSourceBinding,name=JbpmDS
       state: FAILED
       watch: file:/C:/jboss-4.2.2.GA/server/default/deploy/mysql-ds.xml
       altDD: null
       lastDeployed: 1235063072861
       lastModified: 1235063072845
       mbeans:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EjbModule,module=jbpm-enterprise.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.NullPointerException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.NullPointerException)))
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EjbModule,module=jbpm-enterprise.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.NullPointerException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.NullPointerException)))
      
      


      please help me to resolve this, iam breaking the head for the past 2 days

        • 1. Re: where to set the database properties while installing jb
          Mauricio Salatino Master

           

          Deployment FAILED reason: Trying to install an already registered mbean: jboss.jca:service
          =DataSourceBinding,name=JbpmDS

          You are trying to deploy two times the same Datasource..
          please check the deploy directory and look for two files with *-ds.xml


          • 2. Re: where to set the database properties while installing jb
            santhosh samala Newbie

            there was only file mysql-ds.xml I have removed even that, now i am getting following error

            12:41:11,381 INFO [DatasourceConnectionProvider] Using datasource: java:JbpmDS
            12:41:11,381 WARN [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)
             at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
             at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
             at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
             at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
             at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
             at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
             at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
             at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
            
            



            my jbpm-mysql-ds.xml contains

            <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.url}</xa-datasource-property>
             <user-name>${jdbc.mysql.username}</user-name>
             <password>${jdbc.mysql.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 />
            
            ................................
            
            


            My question is do i need to declare mysql-ds.xml in deploy folder with datasource called JbpmDS or I need to overwrite the url ,username and passsword of jbpm-mysql-ds.xml with my own values?

            I have tried to override the values of url etc if jbpm-mysql-ds.xml then there is no error but database tables are not generated automatically..



            • 3. Re: where to set the database properties while installing jb
              Ronald van Kuijk Master

              overwrite or new file, whatever you want, as long as there only is one JbpmDS

              Tables are indeed not generated automatically, either use the ddl that is available in the install dir, or change the hibernate config to automatically generate them for you. Personally, I'd go for the first...