2 Replies Latest reply on Jul 26, 2006 5:01 AM by doankhoavy

    Problem in create-schema of jBPM BPEL

    fwshk

      Excuse me,
      I got problem in create-schema of jBPM BPEL.
      I have try to use the default database or mysql as database but problem still exist.

      My setting:
      - jboss-4.0.2
      - jbpm-bpel-1.0-alpha4
      - ant-1.6.5
      - jwsdp-1.6
      - mysql-connector-java-5.0.0-beta
      - mysql-5.0.18

      My steps:
      1. Extract a new jboss-4.0.2 to C:\JBoss
      2. Extract a new jbpm-bpel-1.0-alpha4 to C:\JBPM_BPEL
      3. Edit C:\JBPM_BPEL\build.properties

      jboss.home=C:/JBoss
      jbpm.bpel.version=1.0-alpha4
      jbpm.version=3.0.2
      

      4. Open command
      CD C:\JBPM_BPEL
      ANT build.service.402
      

      5. Copy C:\JBPM_BPEL\build\jbpm-bpel.sar to C:\JBoss\server\default\deploy
      6. Start C:\JBoss\bin\run.bat
      7. Edit jbpm-bpel-1.0-alpha\doc\examples\hello\build.properties
      wsdp.home=C:/Sun/jwsdp-1.6
      jboss.home=C:/JBoss
      jbpm.bpel.home=C:/JBPM_BPEL
      jboss.server=default
      jbpm.version=3.0.2
      jbpm.bpel.version=1.0-alpha4
      

      8. Open command
      CD C:/JBPM_BPEL/doc/examples/hello
      ANT create-schema
      


      Using default database
      13:28:14,484 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      13:28:14,484 INFO [SessionFactoryImpl] Checking 0 named queries
      13:28:14,484 INFO [JbpmService] binding JbpmSessionFactory 'java:/jbpm/BpelSessionFactory' into JNDI...
      13:28:14,593 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/JBoss/server/default/
      deploy/jboss-xa-jdbc.rar
      13:28:14,734 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/JBoss/server/default/
      deploy/jms/jms-ra.rar
      13:28:14,828 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/JBoss/server/default/
      deploy/mail-ra.rar
      13:28:15,203 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss
      .jca:service=DataSourceBinding,name=DefaultDS to JNDI name 'java:DefaultDS'
      13:28:15,484 INFO [A] Bound to JNDI name: queue/A
      13:28:15,500 INFO [B] Bound to JNDI name: queue/B
      13:28:15,500 INFO [C] Bound to JNDI name: queue/C
      13:28:15,500 INFO [D] Bound to JNDI name: queue/D
      13:28:15,515 INFO [ex] Bound to JNDI name: queue/ex
      13:28:15,546 INFO [testTopic] Bound to JNDI name: topic/testTopic
      13:28:15,546 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
      13:28:15,546 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
      13:28:15,546 INFO [testQueue] Bound to JNDI name: queue/testQueue
      13:28:15,640 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
      13:28:15,687 INFO [DLQ] Bound to JNDI name: queue/DLQ
      13:28:16,656 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager
       'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA to JNDI name 'java:JmsXA'
      13:28:16,703 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/JBoss/server/default/deploy/jmx-consol
      e.war/
      13:28:17,171 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      13:28:17,421 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
      13:28:17,437 INFO [JkMain] Jk running ID=0 time=0/47 config=null
      13:28:17,453 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 27s:
      907ms
      13:28:36,593 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
      13:28:36,593 INFO [Configuration] processing extends queue
      13:28:36,593 INFO [Configuration] processing collection mappings
      13:28:36,593 INFO [Configuration] processing association property references
      13:28:36,593 INFO [Configuration] processing foreign key constraints
      13:28:36,609 INFO [Configuration] processing extends queue
      13:28:36,609 INFO [Configuration] processing collection mappings
      13:28:36,609 INFO [Configuration] processing association property references
      13:28:36,609 INFO [Configuration] processing foreign key constraints
      13:28:36,671 INFO [SchemaExport] Running hbm2ddl schema export
      13:28:36,671 INFO [SchemaExport] exporting generated schema to database
      13:28:36,671 INFO [NamingHelper] JNDI InitialContext properties:{}
      13:28:36,671 INFO [DatasourceConnectionProvider] Using datasource: java:/JbpmBpelDS
      13:28:36,906 INFO [SchemaExport] schema export complete
      13:28:36,921 INFO [[/jbpm-bpel]] DBSchemaServlet: completed database schema operation: create
      13:28:36,921 ERROR [[/jbpm-bpel]] DBSchemaServlet: caught an exception
      java.sql.SQLException: Table not found: BPEL_ALARMDEFINITION in statement [alter table BPEL_ALARMDEFINITION]
       at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
       at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
       at org.hsqldb.jdbc.jdbcStatement.executeUpdate(Unknown Source)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:229)
       at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:145)
       at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:99)
       at org.jbpm.bpel.web.deploy.DBSchemaServlet.createSchema(DBSchemaServlet.java:48)
       at org.jbpm.bpel.web.deploy.DBSchemaServlet.doGet(DBSchemaServlet.java:30)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      13:28:36,921 INFO [[/jbpm-bpel]] DBSchemaServlet: 168 more exceptions caught
      


      9. Edit C:\JBPM_BPEL\src\resources\jbpm-bpel.sar\jbpm-bpel-ds.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>JbpmBpelDS</jndi-name>
       <connection-url>jdbc:mysql://localhost/jbpm</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>jbpm_user</user-name>
       <password>hopesystems</password>
       <exception-sorter-class-name>
       org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
       </exception-sorter-class-name>
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      

      10. Edit C:\JBPM_BPEL\src\resources\jbpm-bpel.sar\hibernate.properties
      # InnoDB supports transactions
      hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
      
      # could also be used, see hibernate and mysql websites for more info
      #hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect
      #hibernate.dialect=org.hibernate.dialect.MySQLDialect
      
      hibernate.connection.datasource=java:JbpmBpelDS
      
      hibernate.show_sql=false
      hibernate.query.substitutions=true 1, false 0
      
      #hibernate.c3p0.min_size=1
      #hibernate.c3p0.max_size=3
      

      11. Open command
      CD C:\JBPM_BPEL
      ANT build.service.402
      

      12. Copy C:\JBPM_BPEL\build\jbpm-bpel.sar to C:\JBoss\server\default\deploy
      13. Copy mysql-connector-java-5.0.0-beta-bin.jar to C:\JBoss\server\default\lib
      14. Open command
      CD C:/JBPM_BPEL/doc/examples/hello
      ANT create-schema
      


      Using MySQL as database
      13:44:15,593 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
      13:44:15,593 INFO [Configuration] processing extends queue
      13:44:15,609 INFO [Configuration] processing collection mappings
      13:44:15,609 INFO [Configuration] processing association property references
      13:44:15,609 INFO [Configuration] processing foreign key constraints
      13:44:15,625 INFO [Configuration] processing extends queue
      13:44:15,625 INFO [Configuration] processing collection mappings
      13:44:15,625 INFO [Configuration] processing association property references
      13:44:15,625 INFO [Configuration] processing foreign key constraints
      13:44:15,687 INFO [SchemaExport] Running hbm2ddl schema export
      13:44:15,687 INFO [SchemaExport] exporting generated schema to database
      13:44:15,687 INFO [NamingHelper] JNDI InitialContext properties:{}
      13:44:15,687 INFO [DatasourceConnectionProvider] Using datasource: java:JbpmBpelDS
      13:44:47,703 INFO [SchemaExport] schema export complete
      13:44:47,718 INFO [[/jbpm-bpel]] DBSchemaServlet: completed database schema operation: create
      13:44:47,718 ERROR [[/jbpm-bpel]] DBSchemaServlet: caught an exception
      com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jbpm.bpel_alarmdefinition' doesn't exist
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2822)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1536)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1626)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:3025)
       at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1147)
       at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1070)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:229)
       at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:145)
       at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:99)
       at org.jbpm.bpel.web.deploy.DBSchemaServlet.createSchema(DBSchemaServlet.java:48)
       at org.jbpm.bpel.web.deploy.DBSchemaServlet.doGet(DBSchemaServlet.java:30)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      13:44:48,000 INFO [[/jbpm-bpel]] DBSchemaServlet: 168 more exceptions caught
      


      I found that the table "bpel_alarmdefinition" is created.
      I have no idea what is the reason, could you tell me are my mistakes?

      Thank you very much ^^
      Roy

        • 1. Re: Problem in create-schema of jBPM BPEL
          aguizar

          I knew this one would be problematic. Hibernate's SchemaExport raises exceptions as part of its normal operation. If no error log appears before the following info log, then the raised exceptions can be disregarded:

          13:28:36,906 INFO [SchemaExport] schema export complete

          Despite the annoying message, the tool creates all tables successfully. I just didn't want the caught exceptions to go unnoticed.

          • 2. Re: Problem in create-schema of jBPM BPEL
            doankhoavy

            You need to add one more line in hibernate.properties file in resource/jbpm-bpel.sar

            # create/update database schema automatically
            hibernate.hbm2ddl.auto=create