5 Replies Latest reply on Jan 25, 2013 12:44 AM by Thomas Setiabudi

    how to export jbpm database tables ?

    eric jiang Newbie

      hello all, I want to export all jbpm tables and import to Oracle database. but I can't find any sql ddl from jboss site or example projects , anyone have any idea? Thanks in advance.

       

       

      update:

      I tried to modify the configuration files.

       

      jbpm-installer/db/persistence.xml:

      <properties>

            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

      ...

       

      jbpm-installer/task-service/resources/META-INF/persistence.xml:

      <properties>

           <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

            <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>

            <property name="hibernate.connection.url" value="jdbc:oracle:thin://192.168.1.228:1521/syjk" />

            <property name="hibernate.connection.username" value="scott"/>

            <property name="hibernate.connection.password" value="scott"/>

      ...

       

      jbpm-installer/standalone.xml:

      <datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                          <connection-url>jdbc:oracle:thin:@192.168.1.228:1521:syjk</connection-url>

                          <driver>oracle</driver>

                          <pool>

                              <min-pool-size>1</min-pool-size>

                              <max-pool-size>4</max-pool-size>

                              <prefill>false</prefill>

                              <use-strict-min>false</use-strict-min>

                              <flush-strategy>FailingConnectionOnly</flush-strategy>

                          </pool>

                          <security>

                             <user-name>scott</user-name>

                             <password>scott</password>

                          </security>

                          <validation>

                             <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>

                             <validate-on-match>false</validate-on-match>

                             <background-validation>false</background-validation>

                          </validation>

                      </datasource>

                      <drivers>

                          <driver name="oracle" module="com.oracle">

                              <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                             

                          </driver>

                      </drivers>

       

                  </datasources>

       

      but, when I run ant start.demo.db, I got errors:

      D:\jbpm\jbpm-5.3.0.Final-installer-full\jbpm-installer>ant start.demo.db

      Buildfile: D:\jbpm\jbpm-5.3.0.Final-installer-full\jbpm-installer\build.xml

       

      check.jboss.version:

       

      download.db.driver.check:

           [echo] Checking if db driver jar has been downloaded ...

       

      download.mysql.driver:

       

      install.db.files:

       

      start.jboss:

       

      check.jboss.version:

       

      start.jboss5:

       

      check.jboss.version:

       

      start.jboss7:

       

      start.human.task:

          [javac] D:\jbpm\jbpm-5.3.0.Final-installer-full\jbpm-installer\build.xml:845: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

           [java] 0    18/09 10:42:33,828[main] ERROR tool.hbm2ddl.SchemaExport.execute  - schema export unsuccessful

           [java] java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)

           [java]     at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)

           [java]     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)

           [java]     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)

           [java]     at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)

           [java]     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:582)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:154)

           [java]     at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

           [java]     at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)

           [java]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:252)

           [java]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:211)

           [java]     at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:353)

           [java]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)

           [java]     at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

           [java]     at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)

           [java]     at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)

           [java]     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

           [java]     at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

           [java]     at org.jbpm.DemoTaskService.main(Unknown Source)

           [java] 2015 18/09 10:42:35,843[main] ERROR hibernate.util.JDBCExceptionReporter.logExceptions  - Io 异常: The Network Adapter could not establish the connection

           [java] 2015 18/09 10:42:35,843[main] WARN  service.persistence.TaskLocalTransactionManager.begin  - Unable to begin transaction

           [java] javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection

       

           [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

           [java]     at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)

           [java]     at org.jbpm.task.service.persistence.TaskLocalTransactionManager.begin(TaskLocalTransactionManager.java:42)

           [java]     at org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)

           [java]     at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlines(TaskPersistenceManager.java:144)

           [java]     at org.jbpm.task.service.TaskServiceSession.scheduleUnescalatedDeadlines(TaskServiceSession.java:231)

           [java]     at org.jbpm.task.service.TaskService.initialize(TaskService.java:116)

           [java]     at org.jbpm.task.service.TaskService.initialize(TaskService.java:101)

           [java]     at org.jbpm.task.service.TaskService.<init>(TaskService.java:79)

           [java]     at org.jbpm.DemoTaskService.main(Unknown Source)

           [java] Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection

           [java]     at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)

           [java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)

           [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

           [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)

           [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)

           [java]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

           [java]     at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)

           [java]     at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)

           [java]     at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)

           [java]     at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)

           [java]     ... 8 more

           [java] Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)

           [java]     at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)

           [java]     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)

           [java]     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)

           [java]     at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)

           [java]     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:582)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:154)

           [java]     at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

           [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

           [java]     ... 13 more

           [java] Exception in thread "main" java.lang.RuntimeException: Unable to begin transaction

           [java]     at org.jbpm.task.service.persistence.TaskLocalTransactionManager.begin(TaskLocalTransactionManager.java:46)

           [java]     at org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)

           [java]     at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlines(TaskPersistenceManager.java:144)

           [java]     at org.jbpm.task.service.TaskServiceSession.scheduleUnescalatedDeadlines(TaskServiceSession.java:231)

           [java]     at org.jbpm.task.service.TaskService.initialize(TaskService.java:116)

           [java]     at org.jbpm.task.service.TaskService.initialize(TaskService.java:101)

           [java]     at org.jbpm.task.service.TaskService.<init>(TaskService.java:79)

           [java]     at org.jbpm.DemoTaskService.main(Unknown Source)

           [java] Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection

           [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

           [java]     at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)

           [java]     at org.jbpm.task.service.persistence.TaskLocalTransactionManager.begin(TaskLocalTransactionManager.java:42)

           [java]     ... 7 more

           [java] Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection

           [java]     at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)

           [java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)

           [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

           [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)

           [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)

           [java]     at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

           [java]     at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)

           [java]     at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)

           [java]     at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)

           [java]     at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)

           [java]     ... 8 more

           [java] Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)

           [java]     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)

           [java]     at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)

           [java]     at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)

           [java]     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)

           [java]     at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)

           [java]     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:582)

           [java]     at java.sql.DriverManager.getConnection(DriverManager.java:154)

           [java]     at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

           [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

           [java]     ... 13 more

           [java] Java Result: 1

       

      Anyone has any idea?