4 Replies Latest reply on Jan 10, 2006 4:38 PM by forjbpm

    java.sql.SQLException: Table already exists: JBPM_ACTION in

    forjbpm

      Hi!

      When I try to test WebsaleTest.java second time I get following error

      java.sql.SQLException: Table already exists: JBPM_ACTION in statement [create table JBPM_ACTION]
      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 com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:63)
      at org.jbpm.db.JbpmSchema.execute(JbpmSchema.java:230)
      at org.jbpm.db.JbpmSchema.createSchema(JbpmSchema.java:149)
      at org.jbpm.db.AbstractDbTestCase.getJbpmSessionFactory(AbstractDbTestCase.java:28)
      at org.jbpm.db.AbstractDbTestCase.beginSessionTransaction(AbstractDbTestCase.java:81)
      at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:71)
      at org.jbpm.websale2.WebSaleTest.setUp(WebSaleTest.java:34)
      at junit.framework.TestCase.runBare(TestCase.java:125)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


      Technically speaking when I do it second time
      super.setup()

      should not initialize jbpmSessionFactory (??)
      Even When I saw the code for AbstractDbTestClass It says:

      if (! isJbpmSessionFactoryInitialized) {}

      Why is it still throwing this SQLException???


        • 1. Re: java.sql.SQLException: Table already exists: JBPM_ACTION
          forjbpm

          and then it also gives me

          java.lang.NullPointerException
          at org.jbpm.db.AbstractDbTestCase.beginSessionTransaction(AbstractDbTestCase.java:81)
          at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:71)
          at org.jbpm.websale2.WebSaleTest.setUp(WebSaleTest.java:34)
          at junit.framework.TestCase.runBare(TestCase.java:125)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

          this exception as a result of it.


          • 2. Re: java.sql.SQLException: Table already exists: JBPM_ACTION
            forjbpm

            Can anyone tell me What may be the cause of this problem???

            Any help is highly appreciated

            Thanks

            • 3. Re: java.sql.SQLException: Table already exists: JBPM_ACTION
              pwang33

              Add this statement
              if (!jbpmSchema.hasJbpmTables())
              before the jbpmSchema.createSchema();
              inside the AbstractDBTestCase

              • 4. Re: java.sql.SQLException: Table already exists: JBPM_ACTION
                forjbpm

                Thanks!!!

                I was under impression that I should not change anything in AbstractdbTestCase class.

                That was really helpful
                Thanks Again!