14 Replies Latest reply on Jan 25, 2010 2:55 AM by Jan Scherf

    jbpm 4: Can't complete task in HSQLDB and DERBY

    Vladimir Penkov Newbie

      I have jbpm 4 + spring. Hibernate conf:

       

      <hibernate-configuration>
          <session-factory>
              <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
              <property name="hibernate.connection.url">jdbc:mysql://localhost/cms</property>
              <property name="show_sql">true</property>
              <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
              <property name="hbm2ddl.auto">update</property>
      
      <!--
              <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
              <property name="hibernate.connection.url">jdbc:derby:target/testdb;create=true</property>
              <property name="show_sql">true</property>
              <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
              <property name="hbm2ddl.auto">create-drop</property>
      -->
      
          </session-factory>
      </hibernate-configuration>
      

       

       

      When I execute

              taskService.completeTask(taskId, outcome);

      I recieve

       

      15:33:09,693 INFO  [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.CompleteTaskCmd@1e2ee3f
      org.hibernate.exception.DataException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2148)
          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:392)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
      Caused by: java.sql.SQLException: Invalid character string format for type BIGINT.
          at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedResultSet.noStateChangeException(Unknown Source)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setString(Unknown Source)
          at org.hibernate.type.StringType.set(StringType.java:26)
          at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
          at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
          at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:515)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
          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:2145)
          ... 67 more
      Caused by: ERROR 22018: Invalid character string format for type BIGINT.
          at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
          at org.apache.derby.iapi.types.DataType.invalidFormat(Unknown Source)
          at org.apache.derby.iapi.types.SQLLongint.setValue(Unknown Source)
          ... 76 more
      

       

       

      In HSQLDB I get:

       

      Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2148)
          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:392)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:250)
          at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:381)
          ... 94 more
      Caused by: java.sql.SQLException: Wrong data type: For input string: "ApproveTask.60014"
          at org.hsqldb.jdbc.Util.throwError(Unknown Source)
          at org.hsqldb.jdbc.jdbcPreparedStatement.setParameter(Unknown Source)
          at org.hsqldb.jdbc.jdbcPreparedStatement.setString(Unknown Source)
          at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.setString(CachedPreparedStatement.java:145)
          at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setString(WrappedPreparedStatement.java:316)
          at org.hibernate.type.StringType.set(StringType.java:26)
          at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
          at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
          at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:515)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
          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:2145)
      
      

       


      ApproveTask - is the name of the process. I checked hsqldb tables: it contains this string.

       

      Then I use Mysql everything works OK. What's wrong?

        • 1. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
          Vladimir Penkov Newbie

          Using debug I see that this query is executed (I've also tried it in oracle)

           

          org.jbpm.pvm.internal.hibernate.DBSessionImpl

            public ClientExecution findProcessInstanceByIdIgnoreSuspended(String processInstanceId) {
              // query definition can be found at the bottom of resource jbpm.pvm.execution.hbm.xml
              Query query = session.getNamedQuery("findProcessInstanceByIdIgnoreSuspended");
              query.setString("processInstanceId", processInstanceId);
              query.setMaxResults(1);
              return (ClientExecution) query.uniqueResult();
            }
          
          

           

           

          Hibernate: select * from ( select executioni0_.DBID_ as DBID1_78_, executioni0_.DBVERSION_ as DBVERSION3_78_, executioni0_.ACTIVITYNAME_ as ACTIVITY4_78_, executioni0_.PROCDEFID_ as PROCDEFID5_78_, executioni0_.HASVARS_ as HASVARS6_78_, executioni0_.NAME_ as NAME7_78_, executioni0_.KEY_ as KEY8_78_, executioni0_.ID_ as ID9_78_, executioni0_.STATE_ as STATE10_78_, executioni0_.SUSPHISTSTATE_ as SUSPHIS11_78_, executioni0_.PRIORITY_ as PRIORITY12_78_, executioni0_.HISACTINST_ as HISACTINST13_78_, executioni0_.PARENT_ as PARENT14_78_, executioni0_.INSTANCE_ as INSTANCE15_78_, executioni0_.SUPEREXEC_ as SUPEREXEC16_78_, executioni0_.SUBPROCINST_ as SUBPROC17_78_ from JBPM4_EXECUTION executioni0_ where executioni0_.DBID_=? and (executioni0_.PARENT_ is null) ) where rownum <= ?
          
          

          here dbid_ (Number type) is used instead of id (varchar type) and parameter is type of string. Why is it so?

          • 2. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
            Vladimir Penkov Newbie
            absolutly the same code works with Mysql
            • 3. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
              Ronald van Kuijk Master

              So to summarize:

              - MySQL: OK

              - HSQLDB: Error

              - Derby: Error

              - Oracle: ???

               

              Do you have a unittest that fails on HSQLDB and succeeds in MySQL? Both are in the jbpm QA matrix (oracle to I think).

              • 4. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                Vladimir Penkov Newbie
                I'll give my conf and test on monday when I'll be back on my work
                • 5. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                  Joram Barrez Master

                  HSQLDB/Oracle/Mysql/Postgres is currently in QA. DB planned for 4.4.

                   

                  If you can provide us a unit test, that would be great!

                  • 6. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                    Vladimir Penkov Newbie

                    so here is test:

                    foo/TaskTests.java

                    package foo;
                    
                    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
                    import org.springframework.test.context.ContextConfiguration;
                    import org.springframework.test.context.transaction.TransactionConfiguration;
                    import org.springframework.transaction.annotation.Transactional;
                    import org.junit.runner.RunWith;
                    import org.junit.Test;
                    import org.jbpm.api.TaskService;
                    import org.jbpm.api.IdentityService;
                    import org.jbpm.api.ProcessInstance;
                    import org.jbpm.api.Execution;
                    import org.jbpm.api.task.Task;
                    import org.jbpm.test.AbstractTransactionalSpringJbpmTestCase;
                    
                    import javax.annotation.Resource;
                    import java.util.List;
                    
                    @RunWith(SpringJUnit4ClassRunner.class)
                    @ContextConfiguration(locations = {
                            "/spring-config.xml"
                    })
                    @Transactional
                    @TransactionConfiguration(transactionManager = "transactionManager")
                    public class TaskTests extends AbstractTransactionalSpringJbpmTestCase {
                    
                    
                        @Resource
                        WorkflowService workflowService;
                    
                        @Resource
                        TaskService taskService;
                    
                        @Resource
                        IdentityService identityService;
                    
                    
                        @Test
                        public void testTask() {
                    
                            assertEquals(0, taskService.findPersonalTasks("tester").size());
                    
                            ProcessInstance pi = workflowService.startApprovingProcess("foo");
                    
                            List<Task> taskList = taskService.findPersonalTasks("tester");
                            assertNotNull(taskList);
                            assertEquals(taskList.size(), 1);
                    
                            Task task = taskList.get(0);
                            taskService.completeTask(task.getId(), "yes");
                    
                            taskList = taskService.findPersonalTasks("tester");
                            assertNotNull(taskList);
                            assertEquals(taskList.size(), 0);
                    
                    
                        }
                    
                    }
                    
                    

                     

                    foo/TaskBean.java

                    package foo;
                    
                    /**
                     * User: Penkov Vladimir
                     * Date: 28.12.2009
                     * Time: 15:22:04
                     */
                    public class TestBean {
                    
                        public void test(String param) {
                            System.out.println(param);
                        }
                    
                    }
                    
                    

                     

                     

                    foo/WorkflowService.java

                    package foo;
                    
                    import org.springframework.stereotype.Component;
                    import org.springframework.stereotype.Service;
                    import org.springframework.beans.factory.annotation.Autowired;
                    import org.springframework.orm.hibernate3.HibernateTemplate;
                    import org.jbpm.pvm.internal.cfg.SpringConfiguration;
                    import org.jbpm.api.*;
                    import org.jbpm.api.task.Task;
                    import org.apache.commons.logging.Log;
                    import org.apache.commons.logging.LogFactory;
                    
                    import javax.annotation.Resource;
                    import javax.annotation.PostConstruct;
                    import java.util.*;
                    
                    /**
                     * User: Penkov Vladimir
                     * Date: 24.12.2009
                     * Time: 12:10:46
                     */
                    public class WorkflowService {
                    
                        private List<String> processDefinitions;
                        private Log logger = LogFactory.getLog(WorkflowService.class);
                    
                    
                        private SpringConfiguration springConfiguration;
                    
                        private RepositoryService repositoryService;
                    
                        private ExecutionService executionService;
                    
                        private TaskService taskService;
                    
                    
                        @PostConstruct
                        public void setupProcessDefinitions() {
                            springConfiguration.buildProcessEngine();
                            for (String processDefinition : processDefinitions) {
                                NewDeployment deployment = repositoryService.createDeployment();
                                deployment.addResourceFromClasspath(processDefinition);
                                deployment.deploy();
                            }
                        }
                    
                        public ProcessInstance startApprovingProcess(String arg) {
                            Map<String, Object> vars = new HashMap<String, Object>();
                            vars.put("param", arg);
                            return executionService.startProcessInstanceByKey("TestTask", vars);
                        }
                    
                        public void setProcessDefinitions(List<String> pd) {
                            this.processDefinitions = pd;
                        }
                    
                        /**
                         * Возвращает все задачи, назначенные данным ролям. Причем роль в данном случае выступает как имя
                         * исполнителя в jpdl файле. То есть, если задача задается так:
                         * <pre>
                         *     &lt;task name="approveTask" assignee="cms-page_publisher">
                         * </pre>
                         *
                         * то чтобы ее получить, нужно передать параметром "cms-page_publisher".
                         * @param roles список ролей
                         * @return список задач
                         */
                        public List<Task> getAssignedTask(String... roles) {
                            List<Task> res = new ArrayList<Task>();
                            for (String role : roles) {
                                res.addAll(taskService.findPersonalTasks(role));
                            }
                            return res;
                        }
                    
                    
                        public Task getTask(String taskId) {
                            return taskService.getTask(taskId);
                        }
                    
                        public Set<String> getTaskOutcomes(String taskId) {
                            return taskService.getOutcomes(taskId);
                        }
                    
                        public void completeTask(String taskId, String outcome) {
                            taskService.completeTask(taskId, outcome);
                        }
                    
                        public Map<String, Object> getTaskVariables(String taskId) {
                            return taskService.getVariables(taskId, taskService.getVariableNames(taskId));
                        }
                    
                        public void setSpringConfiguration(SpringConfiguration springConfiguration) {
                            this.springConfiguration = springConfiguration;
                        }
                    
                        public void setRepositoryService(RepositoryService repositoryService) {
                            this.repositoryService = repositoryService;
                        }
                    
                        public void setExecutionService(ExecutionService executionService) {
                            this.executionService = executionService;
                        }
                    
                        public void setTaskService(TaskService taskService) {
                            this.taskService = taskService;
                        }
                    }
                    
                    

                     

                    hibernate-test.cfg.xml

                    <?xml version='1.0' encoding='utf-8'?>
                    <!DOCTYPE hibernate-configuration PUBLIC
                            "-//Hibernate/Hibernate Configuration DTD//EN"
                            "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                    <hibernate-configuration>
                        <session-factory>
                            <!--
                            <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                            <property name="hibernate.connection.url">jdbc:mysql://localhost/cms</property>
                            <property name="connection.username">cms</property>
                            <property name="connection.password">cms</property>
                            <property name="show_sql">true</property>
                            <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                            <property name="hbm2ddl.auto">update</property>
                    -->
                    
                            <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
                            <property name="hibernate.connection.url">jdbc:derby:target/testdb;create=true</property>
                            <property name="show_sql">true</property>
                            <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
                            <property name="hbm2ddl.auto">create-drop</property>
                    
                        </session-factory>
                    </hibernate-configuration>
                    

                     

                    jbpm.cfg.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <jbpm-configuration>
                    
                        <process-engine-context>
                            <repository-service/>
                            <repository-cache/>
                            <execution-service/>
                            <history-service/>
                            <management-service/>
                            <identity-service/>
                            <task-service/>
                            <command-service name="txRequiredCommandService">
                                <retry-interceptor/>
                                <environment-interceptor/>
                                <spring-transaction-interceptor />
                            </command-service>
                    
                            <deployer-manager>
                                <jpdl-deployer/>
                            </deployer-manager>
                    
                            <object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator">
                                <field name="commandService">
                                    <ref object="txRequiredCommandService"/>
                                </field>
                            </object>
                            <object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager"/>
                    
                            <authentication/>
                            <types resource="jbpm.variable.types.xml"/>
                            <address-resolver/>
                    
                            <script-manager default-expression-language="juel"
                                            default-script-language="juel"
                                            read-contexts="execution, environment,process-engine, spring"
                                            write-context="">
                                <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory"/>
                            </script-manager>
                    
                        </process-engine-context>
                    
                    
                        <transaction-context>
                            <repository-session/>
                            <db-session/>
                            <message-session/>
                            <timer-session/>
                            <history-session/>
                            <hibernate-session factory="jbpmSessionFactory" current="true"/>
                    
                        </transaction-context>
                    </jbpm-configuration>
                    

                     

                     

                    log4j.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
                    
                    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
                    
                        <appender name="console" class="org.apache.log4j.ConsoleAppender">
                            <param name="Target" value="System.out"/>
                            <layout class="org.apache.log4j.PatternLayout">
                                <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
                            </layout>
                        </appender>
                    
                        <appender name="file" class="org.apache.log4j.FileAppender">
                            <param name="File" value="CiscoTest.log"/>
                            <layout class="org.apache.log4j.PatternLayout">
                                <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
                            </layout>
                        </appender>
                    
                        <category name="org.springframework">
                            <priority value="INFO"/>
                        </category>
                    
                    
                        <category name="foo">
                            <priority value="DEBUG"/>
                        </category>
                    
                        <root>
                            <priority value="INFO"/>
                            <appender-ref ref="console"/>
                            <!--<appender-ref ref="file"/>-->
                        </root>
                    
                    </log4j:configuration>
                    

                     

                     

                    spring-config.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <beans xmlns="http://www.springframework.org/schema/beans"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xmlns:context="http://www.springframework.org/schema/context"
                           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
                    
                    
                        <bean id="jbpmSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
                            <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
                            <property name="configLocation" value="hibernate-test.cfg.xml"/>
                            <property name="mappingLocations">
                                <list>
                                    <value>/jbpm.execution.hbm.xml</value>
                                    <value>classpath:jbpm.repository.hbm.xml</value>
                                    <value>classpath:jbpm.task.hbm.xml</value>
                                    <value>classpath:jbpm.history.hbm.xml</value>
                                    <value>classpath:jbpm.identity.hbm.xml</value>
                                </list>
                            </property>
                        </bean>
                    
                        <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
                            <constructor-arg value="/jbpm.cfg.xml"/>
                        </bean>
                    
                    
                        <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine"/>
                        <bean id="repositoryService" factory-bean="jbpmConfiguration" factory-method="getRepositoryService"/>
                        <bean id="executionService" factory-bean="jbpmConfiguration" factory-method="getExecutionService"/>
                        <bean id="taskService" factory-bean="jbpmConfiguration" factory-method="getTaskService"/>
                        <bean id="identityService" factory-bean="jbpmConfiguration" factory-method="getIdentityService"/>
                    
                        <bean id="workflowService" class="foo.WorkflowService">
                            <property name="processDefinitions">
                                <list>
                                    <value>test-task.jpdl.xml</value>
                                </list>
                            </property>
                            <property name="executionService" ref="executionService"/>
                            <property name="repositoryService" ref="repositoryService"/>
                            <property name="springConfiguration" ref="jbpmConfiguration"/>
                            <property name="taskService" ref="taskService"/>
                        </bean>
                    
                    
                    
                        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
                            <property name="sessionFactory" ref="jbpmSessionFactory"/>
                        </bean>
                    
                        <bean id="testBean" class="foo.TestBean"/>
                    
                    </beans>
                    

                     

                    test-task.jpdl.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <process name="TestTask"
                             xmlns="http://jbpm.org/4.2/jpdl"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://jbpm.org/4.2/jpdl ">
                    
                    
                        <start>
                            <transition to="approveTask"/>
                        </start>
                    
                    
                    
                        <task name="approveTask" assignee="tester">
                            <transition name="yes" to="publish"/>
                            <transition name="no" to="end"/>
                        </task>
                    
                    
                        <java name="publish" expr="#{testBean}" method="test">
                            <arg>
                                <object expr="#{param}"/>
                            </arg>
                            <transition to="end"/>
                        </java>
                    
                        <end name="end"/>
                    
                    </process>
                    

                     

                     

                    I have overriden jbpm.execution.hbm.xml:

                    [Deady@penkov src]$ diff ~/archive/programming/libs/jbpm-4.2/srcjbpm.execution.hbm.xml ~/ideaprojects/jbpm_test/src/jbpm.execution.hbm.xml 
                    194c194
                    <     <property name="blob" type="blob"><column name="BLOB_VALUE_" /></property>
                    ---
                    >     <property name="blob" type="blob" ><column name="BLOB_VALUE_" length="65000"/></property>
                    
                    [Deady@penkov src]$ 
                    
                    
                    • 7. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                      Vladimir Penkov Newbie

                      contents of my lib dir (jars from jboss-4.0.4.GA)

                       

                      [Deady@penkov lib]$ ls
                      antlr.jar                    commons-digester-1.8.jar   dom4j-1.6.1.jar             jboss-ejb3x.jar       log4j.jar
                      asm.jar                      commons-discovery-0.4.jar  ehcache.jar                 jbpm.jar              mysql-connector-java-5.1.7-bin.jar
                      aspectjrt.jar                commons-el.jar             ejb3-persistence.jar        jbpm-jpdl.jar         slf4j-api-1.5.8.jar
                      aspectjweaver.jar            commons-lang-2.3.jar       hibernate3.jar              juel-engine.jar       slf4j-simple-1.5.2.jar
                      cglib.jar                    commons-logging-1.1.1.jar  hibernate-annotations.jar   juel-impl.jar         spring.jar
                      commons-beanutils-1.7.0.jar  commons-logging.jar        j2ee.jar                    juel.jar              spring-test.jar
                      commons-collections-3.2.jar  commons-pool-1.3.jar       jbossall-client.jar         junit-4.4.jar
                      commons-dbcp-1.2.2.jar       derby.jar                  jboss-annotations-ejb3.jar  livetribe-jsr223.jar
                      [Deady@penkov lib]$ 
                      • 9. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                        Vladimir Penkov Newbie

                        Mysql - OK

                        Derby:

                        Hibernate: insert into JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'aut', ?)
                        Hibernate: update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?
                        Hibernate: update JBPM4_HIST_PROCINST set DBVERSION_=?, ID_=?, PROCDEFID_=?, KEY_=?, START_=?, END_=?, DURATION_=?, STATE_=?, ENDACTIVITY_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
                        Hibernate: update JBPM4_TASK set DBVERSION_=?, NAME_=?, DESCR_=?, STATE_=?, SUSPHISTSTATE_=?, ASSIGNEE_=?, FORM_=?, PRIORITY_=?, CREATE_=?, DUEDATE_=?, PROGRESS_=?, SIGNALLING_=?, EXECUTION_ID_=?, ACTIVITY_NAME_=?, HASVARS_=?, SUPERTASK_=?, EXECUTION_=?, PROCINST_=?, SWIMLANE_=?, TASKDEFNAME_=? where DBID_=? and DBVERSION_=?
                        Hibernate: update JBPM4_HIST_TASK set DBVERSION_=?, EXECUTION_=?, OUTCOME_=?, ASSIGNEE_=?, PRIORITY_=?, STATE_=?, CREATE_=?, END_=?, DURATION_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
                        Hibernate: update JBPM4_HIST_ACTINST set DBVERSION_=?, HPROCI_=?, TYPE_=?, EXECUTION_=?, ACTIVITY_NAME_=?, START_=?, END_=?, DURATION_=?, TRANSITION_=?, NEXTIDX_=?, HTASK_=? where DBID_=? and DBVERSION_=?
                        Hibernate: select executioni0_.DBID_ as DBID1_0_, executioni0_.DBVERSION_ as DBVERSION3_0_, executioni0_.ACTIVITYNAME_ as ACTIVITY4_0_, executioni0_.PROCDEFID_ as PROCDEFID5_0_, executioni0_.HASVARS_ as HASVARS6_0_, executioni0_.NAME_ as NAME7_0_, executioni0_.KEY_ as KEY8_0_, executioni0_.ID_ as ID9_0_, executioni0_.STATE_ as STATE10_0_, executioni0_.SUSPHISTSTATE_ as SUSPHIS11_0_, executioni0_.PRIORITY_ as PRIORITY12_0_, executioni0_.HISACTINST_ as HISACTINST13_0_, executioni0_.PARENT_ as PARENT14_0_, executioni0_.INSTANCE_ as INSTANCE15_0_, executioni0_.SUPEREXEC_ as SUPEREXEC16_0_, executioni0_.SUBPROCINST_ as SUBPROC17_0_ from JBPM4_EXECUTION executioni0_ where executioni0_.DBID_=? and (executioni0_.PARENT_ is null)
                        15:43:11,095 INFO  [StringType] could not bind value 'TestTask.7' to parameter: 1; Invalid character string format for type BIGINT.
                        15:43:11,096 WARN  [JDBCExceptionReporter] SQL Error: 20000, SQLState: 22018
                        15:43:11,096 ERROR [JDBCExceptionReporter] Invalid character string format for type BIGINT.
                        15:43:11,098 INFO  [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.CompleteTaskCmd@1930ebb
                        org.hibernate.exception.DataException: could not execute query
                            at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
                            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                            at org.hibernate.loader.Loader.doList(Loader.java:2148)
                            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:392)
                            at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
                            at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
                            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                            at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
                            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
                            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:250)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:381)
                            at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:82)
                            at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:45)
                            at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:655)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:615)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:402)
                            at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:194)
                            at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:60)
                            at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
                            at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                            at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
                            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
                            at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
                            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
                            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
                            at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                            at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
                            at foo.TaskTests.testTask(TaskTests.java:55)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:597)
                            at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
                            at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
                            at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
                            at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                            at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                            at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                            at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                            at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                            at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
                            at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
                            at junit.textui.TestRunner.doRun(TestRunner.java:116)
                            at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
                            at junit.textui.TestRunner.doRun(TestRunner.java:109)
                            at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22)
                            at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
                            at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                        Caused by: java.sql.SQLDataException: Invalid character string format for type BIGINT.
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.EmbedResultSet.noStateChangeException(Unknown Source)
                            at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setString(Unknown Source)
                            at org.hibernate.type.StringType.set(StringType.java:26)
                            at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
                            at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
                            at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:515)
                            at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
                            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:2145)
                            ... 54 more
                        Caused by: java.sql.SQLException: Invalid character string format for type BIGINT.
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
                            ... 67 more
                        Caused by: ERROR 22018: Invalid character string format for type BIGINT.
                            at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
                            at org.apache.derby.iapi.types.DataType.invalidFormat(Unknown Source)
                            at org.apache.derby.iapi.types.SQLLongint.setValue(Unknown Source)
                            ... 63 more
                        
                        org.hibernate.exception.DataException: could not execute query
                            at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
                            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                            at org.hibernate.loader.Loader.doList(Loader.java:2148)
                            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:392)
                            at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
                            at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                            at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
                            at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                            at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
                            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
                            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:250)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:381)
                            at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:82)
                            at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:45)
                            at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:655)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:615)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416)
                            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:402)
                            at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:194)
                            at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:60)
                            at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
                            at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                            at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
                            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
                            at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
                            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
                            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
                            at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                            at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
                            at foo.TaskTests.testTask(TaskTests.java:55)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
                            at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
                            at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
                            at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
                            at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                            at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                            at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                            at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                            at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                            at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
                            at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
                            at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                        Caused by: java.sql.SQLDataException: Invalid character string format for type BIGINT.
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.EmbedResultSet.noStateChangeException(Unknown Source)
                            at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setString(Unknown Source)
                            at org.hibernate.type.StringType.set(StringType.java:26)
                            at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
                            at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
                            at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:515)
                            at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
                            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:2145)
                            ... 54 more
                        Caused by: java.sql.SQLException: Invalid character string format for type BIGINT.
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
                            at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
                            ... 67 more
                        Caused by: ERROR 22018: Invalid character string format for type BIGINT.
                            at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
                            at org.apache.derby.iapi.types.DataType.invalidFormat(Unknown Source)
                            at org.apache.derby.iapi.types.SQLLongint.setValue(Unknown Source)
                            ... 63 more
                        
                        15:43:11,145 INFO  [TransactionalTestExecutionListener] Rolled back transaction after test execution for test context [[TestContext@13e02ed testClass = TaskTests, locations = array<String>['classpath:/spring-config.xml'], testInstance = null(foo.TaskTests), testMethod = testTask@TaskTests, testException = org.hibernate.exception.DataException: could not execute query]]
                        15:43:11,158 INFO  [GenericApplicationContext] Closing org.springframework.context.support.GenericApplicationContext@1f06dc3: display name [org.springframework.context.support.GenericApplicationContext@1f06dc3]; startup date [Mon Dec 28 15:43:00 MSK 2009]; root of context hierarchy
                        15:43:11,158 INFO  [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@165f738: defining beans [jbpmSessionFactory,jbpmConfiguration,processEngine,repositoryService,executionService,taskService,identityService,workflowService,transactionManager,testBean,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor]; root of factory hierarchy
                        15:43:11,170 INFO  [LocalSessionFactoryBean] Closing Hibernate SessionFactory
                        15:43:11,170 INFO  [SessionFactoryImpl] closing
                        15:43:11,173 INFO  [DriverManagerConnectionProvider] cleaning up connection pool: jdbc:derby:target/testdb;create=true
                        15:43:11,176 INFO  [SchemaExport] Running hbm2ddl schema export
                        15:43:11,177 INFO  [SchemaExport] exporting generated schema to database
                        15:43:12,190 INFO  [SchemaExport] schema export complete
                        15:43:12,190 WARN  [JDBCExceptionReporter] SQL Warning: 10000, SQLState: 01J01
                        15:43:12,190 WARN  [JDBCExceptionReporter] Database 'target/testdb' not created, connection made to existing database instead.
                        
                        Process finished with exit code 255
                        
                        
                        
                        • 10. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                          Vladimir Penkov Newbie


                          Updated hiberbate-test.cfg.xml for oracle

                           

                          <?xml version='1.0' encoding='utf-8'?>
                          <!DOCTYPE hibernate-configuration PUBLIC
                                  "-//Hibernate/Hibernate Configuration DTD//EN"
                                  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                          <hibernate-configuration>
                              <session-factory>
                                  <!--
                                  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                                  <property name="hibernate.connection.url">jdbc:mysql://localhost/cms</property>
                                  <property name="connection.username">cms</property>
                                  <property name="connection.password">cms</property>
                                  <property name="show_sql">true</property>
                                  <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                                  <property name="hbm2ddl.auto">update</property>
                                  -->
                          
                                  <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
                                  <property name="hibernate.connection.url">jdbc:oracle:thin:@xxxxx:1521:xxxxx</property>
                                  <property name="connection.username">xxxxx</property>
                                  <property name="connection.password">xxxxx</property>
                                  <property name="show_sql">true</property>
                                  <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
                                  <property name="hbm2ddl.auto">update</property>
                          
                          <!--
                                  <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
                                  <property name="hibernate.connection.url">jdbc:derby:target/testdb;create=true</property>
                                  <property name="show_sql">true</property>
                                  <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
                                  <property name="hbm2ddl.auto">create-drop</property>
                          -->
                          
                              </session-factory>
                          </hibernate-configuration>
                          

                           

                           

                          And exception:

                          Hibernate: insert into JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'aut', ?)
                          Hibernate: update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?
                          Hibernate: update JBPM4_HIST_PROCINST set DBVERSION_=?, ID_=?, PROCDEFID_=?, KEY_=?, START_=?, END_=?, DURATION_=?, STATE_=?, ENDACTIVITY_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
                          Hibernate: update JBPM4_TASK set DBVERSION_=?, NAME_=?, DESCR_=?, STATE_=?, SUSPHISTSTATE_=?, ASSIGNEE_=?, FORM_=?, PRIORITY_=?, CREATE_=?, DUEDATE_=?, PROGRESS_=?, SIGNALLING_=?, EXECUTION_ID_=?, ACTIVITY_NAME_=?, HASVARS_=?, SUPERTASK_=?, EXECUTION_=?, PROCINST_=?, SWIMLANE_=?, TASKDEFNAME_=? where DBID_=? and DBVERSION_=?
                          Hibernate: update JBPM4_HIST_TASK set DBVERSION_=?, EXECUTION_=?, OUTCOME_=?, ASSIGNEE_=?, PRIORITY_=?, STATE_=?, CREATE_=?, END_=?, DURATION_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
                          Hibernate: update JBPM4_HIST_ACTINST set DBVERSION_=?, HPROCI_=?, TYPE_=?, EXECUTION_=?, ACTIVITY_NAME_=?, START_=?, END_=?, DURATION_=?, TRANSITION_=?, NEXTIDX_=?, HTASK_=? where DBID_=? and DBVERSION_=?
                          Hibernate: select * from ( select executioni0_.DBID_ as DBID1_0_, executioni0_.DBVERSION_ as DBVERSION3_0_, executioni0_.ACTIVITYNAME_ as ACTIVITY4_0_, executioni0_.PROCDEFID_ as PROCDEFID5_0_, executioni0_.HASVARS_ as HASVARS6_0_, executioni0_.NAME_ as NAME7_0_, executioni0_.KEY_ as KEY8_0_, executioni0_.ID_ as ID9_0_, executioni0_.STATE_ as STATE10_0_, executioni0_.SUSPHISTSTATE_ as SUSPHIS11_0_, executioni0_.PRIORITY_ as PRIORITY12_0_, executioni0_.HISACTINST_ as HISACTINST13_0_, executioni0_.PARENT_ as PARENT14_0_, executioni0_.INSTANCE_ as INSTANCE15_0_, executioni0_.SUPEREXEC_ as SUPEREXEC16_0_, executioni0_.SUBPROCINST_ as SUBPROC17_0_ from JBPM4_EXECUTION executioni0_ where executioni0_.DBID_=? and (executioni0_.PARENT_ is null) ) where rownum <= ?
                          16:24:54,573 WARN  [JDBCExceptionReporter] SQL Error: 1722, SQLState: 42000
                          16:24:54,573 ERROR [JDBCExceptionReporter] ORA-01722: неверное число
                          
                          16:24:54,576 INFO  [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.CompleteTaskCmd@1184326
                          org.hibernate.exception.SQLGrammarException: could not execute query
                              at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
                              at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                              at org.hibernate.loader.Loader.doList(Loader.java:2148)
                              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:392)
                              at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
                              at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                              at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
                              at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                              at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
                              at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
                              at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:250)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:381)
                              at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:82)
                              at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:45)
                              at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:655)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:615)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:402)
                              at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:194)
                              at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:60)
                              at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
                              at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                              at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
                              at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
                              at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
                              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
                              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
                              at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                              at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
                              at foo.TaskTests.testTask(TaskTests.java:50)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                              at java.lang.reflect.Method.invoke(Method.java:597)
                              at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
                              at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
                              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
                              at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                              at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                              at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                              at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                              at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
                              at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
                              at junit.textui.TestRunner.doRun(TestRunner.java:116)
                              at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
                              at junit.textui.TestRunner.doRun(TestRunner.java:109)
                              at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22)
                              at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
                              at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                          Caused by: java.sql.SQLException: ORA-01722: неверное число
                          
                              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
                              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
                              at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
                              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
                              at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
                              at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
                              at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
                              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
                              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
                              at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
                              at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
                              at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
                              at org.hibernate.loader.Loader.doQuery(Loader.java:662)
                              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
                              at org.hibernate.loader.Loader.doList(Loader.java:2145)
                              ... 54 more
                          
                          org.hibernate.exception.SQLGrammarException: could not execute query
                              at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
                              at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                              at org.hibernate.loader.Loader.doList(Loader.java:2148)
                              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:392)
                              at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
                              at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                              at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
                              at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                              at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
                              at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:210)
                              at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:250)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:381)
                              at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:82)
                              at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:45)
                              at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:655)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:615)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416)
                              at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:402)
                              at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:194)
                              at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:60)
                              at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
                              at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                              at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
                              at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
                              at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
                              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
                              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
                              at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                              at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
                              at foo.TaskTests.testTask(TaskTests.java:50)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                              at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
                              at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
                              at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
                              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
                              at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
                              at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
                              at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
                              at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
                              at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
                              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
                              at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
                              at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                          Caused by: java.sql.SQLException: ORA-01722: неверное число
                          
                              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
                              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
                              at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
                              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
                              at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
                              at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
                              at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
                              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
                              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
                              at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
                              at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
                              at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
                              at org.hibernate.loader.Loader.doQuery(Loader.java:662)
                              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
                              at org.hibernate.loader.Loader.doList(Loader.java:2145)
                              ... 54 more
                          
                          16:24:54,792 INFO  [TransactionalTestExecutionListener] Rolled back transaction after test execution for test context [[TestContext@4d2b11 testClass = TaskTests, locations = array<String>['classpath:/spring-config.xml'], testInstance = null(foo.TaskTests), testMethod = testTask@TaskTests, testException = org.hibernate.exception.SQLGrammarException: could not execute query]]
                          16:24:54,800 INFO  [GenericApplicationContext] Closing org.springframework.context.support.GenericApplicationContext@1f06dc3: display name [org.springframework.context.support.GenericApplicationContext@1f06dc3]; startup date [Mon Dec 28 16:24:11 MSK 2009]; root of context hierarchy
                          16:24:54,801 INFO  [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@165f738: defining beans [jbpmSessionFactory,jbpmConfiguration,processEngine,repositoryService,executionService,taskService,identityService,workflowService,transactionManager,testBean,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor]; root of factory hierarchy
                          16:24:54,805 INFO  [LocalSessionFactoryBean] Closing Hibernate SessionFactory
                          16:24:54,805 INFO  [SessionFactoryImpl] closing
                          16:24:54,806 INFO  [DriverManagerConnectionProvider] cleaning up connection pool: jdbc:oracle:thin:@dummy.fotobank.ru:1521:develop
                          
                          Process finished with exit code 255
                          
                          
                          
                          
                          • 11. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                            Jan Scherf Newbie
                            The reason of this problem can be found in org.jbpm.pvm.internal.id.DatabaseIdComposer.createId(...) which is called in org.jbpm.pvm.internal.model.ExecutionImpl.save() to initialize ExecutionImpl.dbid. Property dbid is mapped to database table JBPM4_EXECUTION (see: jbpm.execution.hbm.xml). As you can see in sql-files in ${jbpm.home}/src/db/create, the database-field-datatype of property DBID_ is a kind of integer. But DatabaseIdComposer.createId(...) produces String ...

                             

                            Workaround (worked fine for me):

                            Use integer-values as "key" in you processdefinition.

                            e.g. use <process description="myDescription" key="123" name="myProcess" version="0" xmlns="http://jbpm.org/4.3/jpdl">

                            instead of <process description="myDescription" key="anyString" name="myProcess" version="0" xmlns="http://jbpm.org/4.3/jpdl">

                            • 12. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                              Ronald van Kuijk Master
                              What version of jBPM, I see 4.3 in your processdefinition file, but is that what you use? And what DB? So many things mentioned in there that I'd like to know what you are talking about...
                              • 13. Re: jbpm 4: Can't complete task in HSQLDB and DERBY
                                Ronald van Kuijk Master

                                Ok, it seems that with the introduction of the id generator these scripts were not updated. Please file a jira issue for it.

                                 

                                Letting hibernate do the 'upgrade' might work.