8 Replies Latest reply on May 12, 2009 1:10 PM by Nidhi Batra

    JBPM_PROCESSDEFINITION table not found

    Abdiel Jaramillo Newbie

      hi,

      has anybody seen this error before ?. I created the JBPMConfiguration object from a xml string (Copy and paste from User guide's Chapter 3 Database example). Then i try to create a process instance and i get the error below. It seems like if the persistence service was not available but i initializate exactly as the example.

      09:56:05,220 [main] ERROR JDBCExceptionReporter : Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
      org.hibernate.exception.SQLGrammarException: could not execute query
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.doList(Loader.java:2153)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
       at org.hibernate.loader.Loader.list(Loader.java:2024)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:745)
       at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:138)
       at org.jbpm.JbpmContext.newProcessInstance(JbpmContext.java:266)
       at solicitudes.SolicitudPrestamo.createInstance(SolicitudPrestamo.java:30)
       at solicitudes.Tester.main(Tester.java:13)
      Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
       at org.hsqldb.jdbc.Util.throwError(Unknown Source)
       at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
       at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
       at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
       at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
       at org.hibernate.loader.Loader.doQuery(Loader.java:661)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2150)
       ... 12 more
      0
      


      Creation of JbpmConfiguration Object

       public static JbpmConfiguration getConfiguration()
       {
      
       JbpmConfiguration jbpmConfiguration = null;
      
       // An example configuration file such as this can be found in
       // 'src/config.files'. Typically the configuration information is in the
       // resource file 'jbpm.cfg.xml', but here we pass in the configuration
       // information as an XML string.
      
       // First we create a JbpmConfiguration statically. One JbpmConfiguration
       // can be used for all threads in the system, that is why we can safely
       // make it static.
      
       jbpmConfiguration = JbpmConfiguration.parseXmlString(
       "<jbpm-configuration>" +
      
       // A jbpm-context mechanism separates the jbpm core
       // engine from the services that jbpm uses from
       // the environment.
      
       " <jbpm-context>" +
       " <service name='persistence' " +
       " factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
       " </jbpm-context>" +
      
       // Also all the resource files that are used by jbpm are
       // referenced from the jbpm.cfg.xml
      
       " <string name='resource.hibernate.cfg.xml' " +
       " value='hibernate.cfg.xml' />" +
       " <string name='resource.business.calendar' " +
       " value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
       " <string name='resource.default.modules' " +
       " value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
       " <string name='resource.converter' " +
       " value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
       " <string name='resource.action.types' " +
       " value='org/jbpm/graph/action/action.types.xml' />" +
       " <string name='resource.node.types' " +
       " value='org/jbpm/graph/node/node.types.xml' />" +
       " <string name='resource.varmapping' " +
       " value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
       "</jbpm-configuration>");
      
       return jbpmConfiguration;
      }
      


      Instantiation of process

       public void createInstance() throws Exception
       {
      
       //JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
       JbpmConfiguration jbpmConfiguration = JBPMHelper.getConfiguration();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       try
       {
       ProcessInstance processInstance = jbpmContext.newProcessInstance("SolicitudPrestamo");
       if (processInstance.getProcessDefinition().getTaskMgmtDefinition().getStartTask() == null)
       {
       processInstance.signal();
       }
       else
       {
       TaskInstance startTask =
       processInstance.getTaskMgmtInstance().createStartTaskInstance();
       jbpmContext.save(startTask);
       }
       }
       finally
       {
       jbpmContext.close();
       }
       }
      


      Thanks in advance for your help.