9 Replies Latest reply on Jan 29, 2007 8:51 AM by cdart_rrr

    jbpm-db readme followed to point 10 - then errors on ant mss

    monkmanusa

      Hello all,
      Some Background:
      I am a newbie to jBPM (and a "relative" java novice) - so apologies if my questions seem dumb. I am in the process of trying to determine a workflow engine to be embedded within the applications that my company develops. So far I like what I see with regards to jBPM. I cannot "disturb" my brain trust of developers (who are java brainiacs) until I can determine that I can get this thing up and running in our environment.
      I have downloaded the starter kit and unzipped.
      Downloaded Eclipse and I have got the designer working inside eclipse
      Have run thru the example in the wiki and all good.
      Now I want to make this work over a MSSQL DB and store my defined processes wihtin that DB and use that as the basis for persistence etc.
      So decided to work my way thru the readme in the jbpm-db folder that comes along with the starter kit - as it seemed to say that this provides the mechanism to make jbpm run over any supported DB (including MSSQL).

      Problems Encountered:
      I followed the instructions, I even downloaded apache ant and got that up and running. I even managed to work thru the first issue with the "ant mssql.test" - this seems to require JDK 1.5 in order to compile correctly - though the readme says it will work with 1.4 (not so).
      Anyhow - got past that and now i am running the test - but I get a set or "errors" during the test, and when I look at the testresults folder using the summary the errors are documented there.

      Here is the section of the console that contains the errors (it is large so I have not included the whole thing - let me know if there is anything else needed to be able to detemine what the problem is):

      [junit] 15:24:24,468 [main] DEBUG JbpmContext : creating JbpmContext
      [junit] 15:24:24,468 [main] INFO SchemaExport : Running hbm2ddl schema export
      [junit] 15:24:24,468 [main] INFO SchemaExport : exporting generated schema to database
      [junit] 15:24:24,468 [main] INFO C3P0ConnectionProvider : C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.;sql.enforc
      e_strict_size=true
      [junit] 15:24:24,468 [main] INFO C3P0ConnectionProvider : Connection properties: {user=sa, password=****}
      [junit] 15:24:24,468 [main] INFO C3P0ConnectionProvider : autocommit mode: false
      [junit] 15:24:24,484 [main] DEBUG JbpmContext : closing JbpmContext
      [junit] 15:24:24,484 [main] DEBUG JbpmContextInfo : creating jbpm context with service factories '[message, scheduler, logging, persiste
      nce, authentication]'
      [junit] 15:24:24,484 [main] DEBUG JbpmContext : creating JbpmContext
      [junit] 15:24:24,484 [main] INFO SchemaExport : Running hbm2ddl schema export
      [junit] 15:24:24,484 [main] INFO SchemaExport : exporting generated schema to database
      [junit] 15:24:24,484 [main] INFO C3P0ConnectionProvider : C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.;sql.enforc
      e_strict_size=true
      [junit] 15:24:24,484 [main] INFO C3P0ConnectionProvider : Connection properties: {user=sa, password=****}
      [junit] 15:24:24,484 [main] INFO C3P0ConnectionProvider : autocommit mode: false
      [junit] 15:24:24,484 [main] DEBUG JbpmContext : closing JbpmContext
      [junit] Tests run: 4, Failures: 0, Errors: 4, Time elapsed: 1.391 sec
      [junit] Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.close(Ljava/io/Writer;)V
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:174)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:620)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:453)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:743)
      [junit] Running org.jbpm.taskmgmt.log.TaskLogDbTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      [junit] Tests FAILED (crashed)
      [junit] Running org.jbpm.context.exe.HibernateCustomizationTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      [junit] Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.close(Ljava/io/Writer;)V
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:174)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:620)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:453)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
      [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
      [junit] Running org.jbpm.context.exe.HibernateCustomizationTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      [junit] Test org.jbpm.context.exe.HibernateCustomizationTest FAILED (crashed)
      [junitreport] Processing C:\JBoss\jbpm-db\build\mssql\testresults\xml\TESTS-TestSuites.xml to C:\DOCUME~1\Steve\LOCALS~1\Temp\null1126484348

      [junitreport] Loading stylesheet jar:file:/C:/apache/ant/apache-ant-1.7.0/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xs
      l/junit-frames.xsl
      [junitreport] Transform time: 406ms
      [junitreport] Deleting: C:\DOCUME~1\Steve\LOCALS~1\Temp\null1126484348

      BUILD SUCCESSFUL
      Total time: 3 seconds
      C:\JBoss\jbpm-db>


      In the testresults summary I have this (note I only inclued the first couple of test errors - there are more but I dare say if I can fix the first they will all fall into line):

      All Tests
      Class Name Status Type Time(s)
      ByteArrayDbTest testManyBlocks Error com/mchange/v2/c3p0/PoolConfig

      java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
      at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:84)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      at org.hibernate.tool.hbm2ddl.SchemaExport$ProviderConnectionHelper.getConnection(SchemaExport.java:466)
      at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:183)
      at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:135)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:107)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:415)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:407)
      at org.jbpm.db.AbstractDbTestCase.createSchema(AbstractDbTestCase.java:122)
      at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:55)
      1.359
      ByteArrayDbTest testEmptyByteArray Error com/mchange/v2/c3p0/PoolConfig

      java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
      at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:84)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      at org.hibernate.tool.hbm2ddl.SchemaExport$ProviderConnectionHelper.getConnection(SchemaExport.java:466)
      at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:183)
      at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:135)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:107)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:415)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:407)
      at org.jbpm.db.AbstractDbTestCase.createSchema(AbstractDbTestCase.java:122)
      at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:55)



      Is there something that I am missing or doing wrong?
      Are there any pre-requisites other than those mentioned in the db readme?

      if anyone can provide some pointers as to where I might look - I would greatly appreciate it.

      Many thanks,
      monkmanusa.




        • 1. Re: trying to get jbpm up on MSSQL - following readme in jbp
          monkmanusa

          Hi all,
          I really need some help here if anyone could point me in the right direction as I am stuck and dead in the water.
          Anything anyone could suggest would be greatly appreciated.
          Many thanks,

          • 2. Re: jbpm-db readme followed to point 10 - then errors on ant
            cpob

            You need the c3p0-0.9.0.jar (Assuming hibernate 3.1.x) in your classpath

            • 3. Re: jbpm-db readme followed to point 10 - then errors on ant
              monkmanusa

              I added the folder that contains the jar mentioned to the "path" environment variable on my machine - but I get the same issue. I assume that that is what was meant by adding that jar to the classpath. If this is not correct - is there something else I should do to add this to the classpath?
              If there any any other ideas I would greatly appreciate it.
              It seems quite a long drawn out complicatd process to tell the application to simply use a different database......

              Am I missing any pre-requisites that the readme does not mention (it claims to be the step by step process to get it working on any supported db - but it don't seem to want to work for me).

              Many thanks.
              Steve.

              • 4. Re: jbpm-db readme followed to point 10 - then errors on ant
                cpob

                The path environment variable is not the same as your classpath.

                Readup on java and what the classpath is, and how to set it up in your environment. Then add the .jar to the classpath.

                • 5. Re: jbpm-db readme followed to point 10 - then errors on ant
                  monkmanusa

                  I thought I had got it wrong.
                  More than happy to do that - any suggestions as to the best place to do the "reading"? There seems to be a huge excess of reading available when I do a search - if you could suggest the best place to start then that will work.
                  Thanks

                  • 6. Re: jbpm-db readme followed to point 10 - then errors on ant
                    monkmanusa

                    Well I think I found something to read......will go thru it and see what happens ....
                    Thanks,

                    • 7. Re: jbpm-db readme followed to point 10 - then errors on ant
                      cpob

                      The java tutorial is always a good start for new java developers http://java.sun.com/docs/books/tutorial/

                      Then, learn eclipse and how to define projects/classpaths/etc. Either check eclipse.org or poke around until you figure it out. Or ask one of the java resources you have there.

                      • 8. Re: jbpm-db readme followed to point 10 - then errors on ant
                        cdart_rrr

                        hi,
                        yes I'm doing similar to you, same problems. But I've got one step further on. With your problem it's getting class not found for com/mchange/v2/c3p0/PoolConfig, so I located this on the www (as c3p0-0.9.0.jar - which wants to then go in ...\jbpm\lib\jboss).

                        So then on to the next problem

                        [junit] 11:22:51,022 [main] DEBUG BasicResourcePool : trace com.mchange.v2.resourcepool.BasicResourcePool@3b8b49 [managed: 0, unused: 0, excluded: 0]
                        [junit] 11:22:51,444 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] DEBUG BasicResourcePool : trace com.mchange.v2.resourcepool.BasicResourcePool@3b8b49 [managed: 1, unused: 1, excluded: 0]
                        [junit] 11:22:51,444 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] DEBUG BasicResourcePool : trace com.mchange.v2.resourcepool.BasicResourcePool@3b8b49 [managed: 2, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3c9217)
                        [junit] 11:22:51,460 [main] DEBUG BasicResourcePool : trace com.mchange.v2.resourcepool.BasicResourcePool@3b8b49 [managed: 2, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3c9217)
                        [junit] alter table JBPM_ACTION drop constraint FK_ACTION_EVENT
                        [junit] 11:22:51,491 [main] DEBUG NewPooledConnection : com.mchange.v2.c3p0.impl.NewPooledConnection@3c9217 handling a throwable.
                        [junit] java.sql.SQLException: Table not found: JBPM_ACTION in statement [alter table JBPM_ACTION]
                        [junit] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
                        

                        So this looks like it can't find the table on the db to drop the constraint. I've created the db (jbpmtest) on mssql and checked that I can indeed create, drop etc the tables with the scripts. I've updated hibernate.properties for my db, user, pw etc. So I guess it's not connecting to the right db? ALthough I may have expected an error to say db (name) not present rather than table not found.

                        So just the last bit to get the test to connect. I should think from the test failure (above) that it's just the final connection to the right db...

                        Any ideas?

                        Brgds...

                        rr

                        • 9. Re: jbpm-db readme followed to point 10 - then errors on ant
                          cdart_rrr

                          Quick update: above point that I'd reached - it was still trying to connect to wrong db. Just up in the log I had in the middle of the actual connection details...

                          ...jdbc:hsqldb:mem:.;sql.enforce_strict_size=true...

                          So it looked like this also needed changing in hibernate.cfg.xml. Duly done, I was then on to the next failure...

                          [junit] 14:26:26,890 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] DEBUG BasicResourcePool$AcquireTask : An exception occurred while acquiring a resource.
                          [junit] java.sql.SQLException: Network error IOException: Connection refused: connect

                          This one turned out to be a problem with my SQLserver (desktop edition) - eventually by running the server network utility (not the client version) it was clear that neither TCP nor named pipes were enabled. Once enabled, the connection was established. On to the next...

                          And the next (current) was/is that the test doesn't run unless it has a database to delete. When it does, it successfully establishes a connection, alters the tables to drop the constraints, then drops the tables. But then it stops afterwards trying to remove the table constraints ready to delete the table - it appears that the db wasn't successfully recreated due to a failure just before...

                          [junit] java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().
                          [junit] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:417)
                          [junit] at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:429)
                          [junit] ...

                          This may well be the processing that was trying to create the db...

                          Once again, any ideas?

                          Brgds...

                          \rr