Ok. Fine. I tried the code below, where i defined the process in the code 
itself and tried to deploy it. But the error remains the same.
Help me out in solving this problem.

--------------------------------------------------------------------------------------

package org.jbpm.tutorial.db;

import java.util.List;

import junit.framework.TestCase;

import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.db.GraphSession;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;

public class CopyOfHelloWorldDbTest extends TestCase {
  
  static JbpmConfiguration jbpmConfiguration = null; 

  static {

    jbpmConfiguration = JbpmConfiguration.parseXmlString(
      "<jbpm-configuration>" +
      
      
      "  <jbpm-context>" +
      "    <service name='persistence' " +
      "             
factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" + 
      "  </jbpm-context>" +
      
      
      "  <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>"
    );
  }
  
  public void setUp() {
    jbpmConfiguration.createSchema();
  }
  
  public void tearDown() {
    jbpmConfiguration.dropSchema();
  }

  public void testSimplePersistence() {
    deployProcessDefinition();
    processInstanceIsCreatedWhenUserSubmitsWebappForm();
    theProcessInstanceContinuesWhenAnAsyncMessageIsReceived();
  }

  public void deployProcessDefinition() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition name='MyProcess'>" +
      "  <start-state name='start'>" +
      "    " +
      "  </start-state>" +
      "  " +
      "    " +
      "  " +
      "  <end-state name='end' />" +
      "</process-definition>"
    );

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
        System.out.println("Before Deploy------------------");
      jbpmContext.deployProcessDefinition(processDefinition);

    } finally {
      jbpmContext.close();
    }
  }

  public void processInstanceIsCreatedWhenUserSubmitsWebappForm() {
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {

      GraphSession graphSession = jbpmContext.getGraphSession();
      
      ProcessDefinition processDefinition = 
          graphSession.findLatestProcessDefinition("MyProcess");
      ProcessInstance processInstance = 
          new ProcessInstance(processDefinition);
      
      Token token = processInstance.getRootToken(); 
      assertEquals("start", token.getNode().getName());
      token.signal();
      assertEquals("s", token.getNode().getName());
      
      jbpmContext.save(processInstance);

    } finally {
      jbpmContext.close();
    }
  }

  public void theProcessInstanceContinuesWhenAnAsyncMessageIsReceived() {
    
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {

      GraphSession graphSession = jbpmContext.getGraphSession();
      ProcessDefinition processDefinition = 
          graphSession.findLatestProcessDefinition("MyProcess");

      List processInstances = 
          graphSession.findProcessInstances(processDefinition.getId());
      
      ProcessInstance processInstance = 
          (ProcessInstance) processInstances.get(0);
      processInstance.signal();

      assertTrue(processInstance.hasEnded());
      
      jbpmContext.save(processInstance);

    } finally {
      jbpmContext.close();
    }
  }
  public static void main(String args[]){
          new CopyOfHelloWorldDbTest().testSimplePersistence();
  }
}


--------------------------------------------------------------------------------------
The output in conole window shows the same error

15:24:42,613 [main] INFO  SessionFactoryObjectFactory : Not binding factory to 
JNDI, no JNDI name configured
15:24:42,613 [main] INFO  SessionFactoryImpl : Checking 25 named HQL queries
15:24:43,238 [main] INFO  SessionFactoryImpl : Checking 0 named SQL queries
15:24:43,238 [main] DEBUG DbPersistenceService : creating hibernate session
15:24:43,332 [main] DEBUG DbPersistenceService : beginning hibernate transaction
15:24:43,848 [main] WARN  JDBCExceptionReporter : SQL Error: -22, SQLState: 
S0002
15:24:43,863 [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.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
        at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.deployProcessDefinition(CopyOfHelloWorldDbTest.java:133)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.testSimplePersistence(CopyOfHelloWorldDbTest.java:100)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.main(CopyOfHelloWorldDbTest.java:228)
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.(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)
        ... 14 more
15:24:44,066 [main] ERROR GraphSession : 
org.hibernate.exception.SQLGrammarException: could not execute query
15:24:44,066 [main] DEBUG JbpmContext : closing JbpmContext
15:24:44,066 [main] DEBUG Services : closing service 'persistence': [EMAIL 
PROTECTED]
15:24:44,066 [main] DEBUG DbPersistenceService : committing hibernate 
transaction
15:24:44,066 [main] DEBUG DbPersistenceService : closing hibernate session
org.jbpm.JbpmException: couldn't find process definition 'MyProcess'
        at 
org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:155)
        at 
org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
        at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.deployProcessDefinition(CopyOfHelloWorldDbTest.java:133)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.testSimplePersistence(CopyOfHelloWorldDbTest.java:100)
        at 
org.jbpm.tutorial.db.CopyOfHelloWorldDbTest.main(CopyOfHelloWorldDbTest.java:228)
Caused by: 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)
        ... 5 more
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.(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)
        ... 14 more


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3938624#3938624

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3938624


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to