5 Replies Latest reply on Jun 22, 2006 4:55 AM by kukeltje

    Unable to deploy process definition

      Hi all,
      I've been unsuccessfully trying to deploy a simple process definition using db persistence. I'm trying to run from eclipse with the jboss plugin installed and the project is a jbpm project. I've changed nothing except for creating a copy of the config files and modifying hibernate.cfg.xml to connect to my database (I've tried 3 databases hsql/mysql/oracle :(...).

      Can anyone direct me to what I'm doing wrong or how to get the deployment working? Please.

      Heres the code

      public class TestDBWF {
       public static void main(String[] args) {
       try {
       JbpmContext context = JbpmContext.getCurrentJbpmContext();
       if ( context == null ) {
       JbpmConfiguration config = JbpmConfiguration
       .parseInputStream(new FileInputStream(new File("src/config.files/jbpm.cfg.xml")));
       context = config.createJbpmContext();
       if ( context == null ) {
       System.out.println("Failed to create a context");
       return;
       }
       }
       ProcessDefinition definition = ProcessDefinition.parseXmlInputStream(
       new FileInputStream("processes/testProcess/processdefinition.xml"));
       System.out.println("Process definition loaded");
       context.deployProcessDefinition(definition);
       context.close();
      
       } catch(Exception ioe) {
       System.out.println(ioe);
       }
       }
      }
      


      I keep getting the following exception
      ...
      20:54:19,149 DEBUG Configuration : resolving reference to class: org.jbpm.taskmgmt.exe.TaskInstance
      20:54:19,149 DEBUG Configuration : resolving reference to class: org.jbpm.bytes.ByteArray
      org.hibernate.MappingException: Could not determine type for: string_max, for columns: [org.hibernate.mapping.Column(EXCEPTION_)]


      my jbpm.cfg.xml looks like this
      <jbpm-configuration>
      
       <!--
       This configuration is used when there is no jbpm.cfg.xml file found in the
       root of the classpath. It is a very basic configuration without persistence
       and message services. Only the authorization service installed.
       You can parse and create processes, but when you try to use one of the
       unavailable services, you'll get an exception.
       -->
      
       <jbpm-context>
       <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
       <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
       <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
       </jbpm-context>
      
       <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
       <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.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
      
       <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
       <int name="jbpm.byte.block.size" value="1024" singleton="true" />
       <string name="mail.smtp.host" value="localhost" />
       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
       <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
      
      </jbpm-configuration>


      and hibernate.cfg.xml ... (the tables have already been created by modifying existing db creation scripts for hsql http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85053)
      <?xml version='1.0' encoding='utf-8'?>
      
      <!DOCTYPE hibernate-configuration PUBLIC
       "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      
      <hibernate-configuration>
       <session-factory>
      
       <!-- jdbc connection properties -->
       <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
       <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
       <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmdb</property>
       <property name="hibernate.connection.username">wfe</property>
       <property name="hibernate.connection.password">wfe</property>
       <!--
       <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
       <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
       <property name="hibernate.connection.url">jdbc:hsqldb:.;sql.enforce_strict_size=true</property>
       <property name="hibernate.connection.username">sa</property>
       <property name="hibernate.connection.password"></property>
       -->
       <!-- c3p0 connection pooling properties -->
       <!--
       <property name="hibernate.c3p0.min_size">1</property>
       <property name="hibernate.c3p0.max_size">3</property>
       -->
      
       <!-- other hibernate properties -->
       <property name="hibernate.show_sql">true</property>
      
       <!--identity mapping files -->
       <!-- uncomment if you don't want to use the default jBPM identity mgmgt component -->
       <mapping resource="org/jbpm/identity/User.hbm.xml"/>
      ...
       <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
      
       </session-factory>
      </hibernate-configuration>