2 Replies Latest reply on Oct 30, 2012 1:05 PM by Maciej Swiderski

    taskservice error in jbpm5.3 with mysql

    Kehua Gao Newbie

      hi, I try the taskservice code in jbpm5.3 with mysql,it occurs error as follow:

      java.lang.IllegalArgumentException: Named query not found: UnescalatedDeadlines

           at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:108)

           at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlinesList(TaskPersistenceManager.java:174)

           at org.jbpm.task.service.persistence.TaskPersistenceManager.getUnescalatedDeadlines(TaskPersistenceManager.java:146)

           at org.jbpm.task.service.TaskServiceSession.scheduleUnescalatedDeadlines(TaskServiceSession.java:231)

           at org.jbpm.task.service.TaskService.initialize(TaskService.java:116)

           at org.jbpm.task.service.TaskService.initialize(TaskService.java:101)

           at org.jbpm.task.service.TaskService.(TaskService.java:79)

           at com.sample.TaskServer.main(TaskServer.java:26)

       

      taskservice code:

       

      package com.sample;

       

      import javax.persistence.EntityManagerFactory;

      import javax.persistence.Persistence;

       

      import org.drools.SystemEventListenerFactory;

      import org.jbpm.task.User;

      import org.jbpm.task.service.TaskService;

      import org.jbpm.task.service.TaskServiceSession;

      import org.jbpm.task.service.mina.MinaTaskServer;

       

      import bitronix.tm.resource.jdbc.PoolingDataSource;

       

      public class TaskServer {

       

           /**

           

      • @param args

            */

           public static final void main(String[] args) {

                

                try {

                     

                     

                                

                     EntityManagerFactory emfTask = Persistence.createEntityManagerFactory( "org.jbpm.task" );

                     TaskService taskService = new TaskService(emfTask, SystemEventListenerFactory.getSystemEventListener());

                     

                     

                     

                     /*

                   

      • Add the required users

                    */

                   TaskServiceSession taskSession = taskService.createSession();  

                   taskSession.addUser(new User("Administrator"));

                   taskSession.addUser(new User("krisv"));

                  

                   /* Start Mina server for HT*/

                   MinaTaskServer server = new MinaTaskServer(taskService);

                   Thread thread = new Thread(server);

                   thread.start();

                   System.out.println("Server started ...");

                 

                

                } catch (Throwable t) {

                     t.printStackTrace();

                }

           }

       

       

           

           

       

      }

       

        • 1. Re: taskservice error in jbpm5.3 with mysql
          Kehua Gao Newbie

          add "<mapping-file>META-INF/Taskorm.xml</mapping-file>" into persistence.xml, the problem has solved. but a few tables have not been created in mysql,such as ProcessInstanceInfo,

          <persistence-unit name="org.jbpm.task">
                  <provider>org.hibernate.ejb.HibernatePersistence</provider>
                  
                  <mapping-file>META-INF/Taskorm.xml</mapping-file>
            
                  <class>org.jbpm.task.Attachment</class>
                  <class>org.jbpm.task.Content</class>
                  <class>org.jbpm.task.BooleanExpression</class>
                  <class>org.jbpm.task.Comment</class>
                  <class>org.jbpm.task.Deadline</class>
                  <class>org.jbpm.task.Comment</class>
                  <class>org.jbpm.task.Deadline</class>
                  <class>org.jbpm.task.Delegation</class>
                  <class>org.jbpm.task.Escalation</class>
                  <class>org.jbpm.task.Group</class>
                  <class>org.jbpm.task.I18NText</class>
                  <class>org.jbpm.task.Notification</class>
                  <class>org.jbpm.task.EmailNotification</class>
                  <class>org.jbpm.task.EmailNotificationHeader</class>
                  <class>org.jbpm.task.PeopleAssignments</class>
                  <class>org.jbpm.task.Reassignment</class>
                  <class>org.jbpm.task.Status</class>
                  <class>org.jbpm.task.Task</class>
                  <class>org.jbpm.task.TaskData</class>
                  <class>org.jbpm.task.SubTasksStrategy</class>
                  <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
                  <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
                  <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

                  <class>org.jbpm.task.User</class>

           

                  <class>org.drools.persistence.info.SessionInfo</class>
                 <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
                  <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
                  <class>org.drools.persistence.info.WorkItemInfo</class>
                 

                  <properties>

           

                                  
                       <!-- Sample mysql Configuration  -->
                                  
                      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
                      <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
                      <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/jbpm-demo" />
                      <property name="hibernate.connection.username" value="demo"/>
                      <property name="hibernate.connection.password" value="demo"/>
                     
                     
                     
                      <property name="hibernate.connection.autocommit" value="false" />
                      <property name="hibernate.max_fetch_depth" value="3"/>
                      <property name="hibernate.hbm2ddl.auto" value="create" />
                      <property name="hibernate.show_sql" value="false" />
                  </properties>
              </persistence-unit>

           

          copy 4 xml files in jbpm-persistence-jpa-5.3.0.Final.jar ,ProcessInstanceInfo has been created in mysql

          the problem has fully been solved.

          • 2. Re: taskservice error in jbpm5.3 with mysql
            Maciej Swiderski Master

            since the problem is solved, do you mind marking it as answered?

             

            cheers