4 Replies Latest reply on Oct 30, 2007 7:47 AM by ravkar

    Get a list of taskinstances using jpdl-  error-local class i

    Anuradha Sultane Newbie

      I have written a code to get a list of taskinstances for a particular user using jpdl.

      But i am getting an exception in it

      Exception :
      java.lang.reflect.UndeclaredThrowableException
      Cause : java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -5723701046347946317
      StackTrace : [Ljava.lang.StackTraceElement;@18ee9d6


      The code is-

      package com.sample.action;

      import javax.rmi.*;
      import javax.naming.*;
      import org.jbpm.ejb.*;
      import org.jbpm.command.*;
      import org.jbpm.taskmgmt.exe.TaskInstance;
      import java.util.List;

      public class Test1
      {
      public static void main (String[] args)
      {
      String[] actors = {"Anuradhaps"};
      try
      {
      Context c = new InitialContext();
      Object o = c.lookup ("ejb/CommandServiceBean");
      RemoteCommandServiceHome home =(RemoteCommandServiceHome)PortableRemoteObject.narrow (o,RemoteCommandServiceHome.class);
      RemoteCommandService RemoteCommandService = home.create();
      GetTaskListCommand command = new GetTaskListCommand(actors);
      List result = (List) RemoteCommandService.execute(command);
      if ( result.isEmpty())
      {
      System.out.println("List empty");
      }
      else
      {
      TaskInstance TaskInstance=null;
      while(result.iterator().hasNext())
      {
      TaskInstance =(TaskInstance)result.iterator().next();
      System.out.println("name of task : " + TaskInstance.getName());
      }
      }
      }
      catch(Exception e)
      {
      System.out.println("Exception : " +e.toString());
      System.out.println("Cause : " +e.getCause());
      System.out.println("StackTrace : " +e.getStackTrace());
      System.out.println("Message : " +e.getMessage());
      }
      }
      }

      Please help me solve this issue.

      Regards,
      Anuradha