2 Replies Latest reply on Sep 28, 2005 3:36 PM by Marcos Donato

    Classloader problem

    Marcos Donato Newbie

      Hi All

      I'm having trouble with the load of an assignment class,

      this is the class

      package br.com.glr.populis.model.workflow.common.handler;
      
      import org.jbpm.graph.exe.ExecutionContext;
      import org.jbpm.taskmgmt.def.AssignmentHandler;
      import org.jbpm.taskmgmt.exe.Assignable;
      
      public class PessoaAssignmentHandler implements AssignmentHandler {
      
       public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
       assignable.setActorId("1");
       }
      }
      
      


      processdefinition.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition name="teste-swinlane">
       <swimlane name="pessoa">
       <assignment class="br.com.glr.populis.model.workflow.common.handler.PessoaAssignmentHandler"/>
       </swimlane>
       <start-state name="start">
       <transition name="tr1" to="task1"></transition>
       </start-state>
       <task-node name="task1">
       <task name="task1" swimlane="pessoa">
       </task>
       <transition name="tr1" to="node1"></transition>
       <transition name="tr2" to="node2"></transition>
       </task-node>
       <end-state name="end1"></end-state>
       <node name="node1">
       <transition name="tr1" to="end1"></transition>
       </node>
       <node name="node2">
       <transition name="tr1" to="end1"></transition>
       </node>
      </process-definition>
      



      exception
      [27/09/05 18:02:00:369 GMT-03:00] c119352 ExceptionUtil E CNTR0020E: Ocorreu uma exceção de não aplicativo ao processar método "startProcess" no bean "BeanId(populis-ear#populis-workflow-ejb.jar#WorkflowSessionFacade, null)". Dados da exceção:org.jbpm.graph.def.DelegationException
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:299)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:293)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:293)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.invokeAssignmentHandler(TaskMgmtInstance.java:149)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.getInitializedSwimlaneInstance(TaskMgmtInstance.java:131)
       at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:130)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:102)
       at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:136)
       at org.jbpm.graph.def.Node.enter(Node.java:284)
       at org.jbpm.graph.def.Transition.take(Transition.java:92)
       at org.jbpm.graph.def.Node.leave(Node.java:349)
       at org.jbpm.graph.node.StartState.leave(StartState.java:73)
       at org.jbpm.graph.exe.Token.signal(Token.java:127)
       at org.jbpm.graph.exe.Token.signal(Token.java:92)
       at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:201)
       at br.com.glr.populis.model.workflow.common.MainWorkflow.startProcess(MainWorkflow.java:179)
       at br.com.glr.populis.model.workflow.ejb.WorkflowSessionFacadeBean.startProcess(WorkflowSessionFacadeBean.java:107)
       at br.com.glr.populis.model.workflow.ejb.EJSLocalStatelessWorkflowSessionFacade_618810f4.startProcess(EJSLocalStatelessWorkflowSessionFacade_618810f4.java:215)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
       at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
       at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
       at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
       at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:366)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
       at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
       at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
       at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
       at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
       at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
       at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
       at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
       at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
       at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
       at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
       at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
       at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
       at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
       at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
       at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
       at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
       at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
       at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
       at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
      Caused by: java.lang.RuntimeException: couldn't get value for file 'classes/br/com/glr/populis/model/workflow/common/handler/PessoaAssignmentHandler.class'
       at org.jbpm.file.def.FileDefinition.getBytes(FileDefinition.java:160)
       at org.jbpm.instantiation.ProcessClassLoader.findClass(ProcessClassLoader.java:34)
       at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
       at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
       at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:105)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.invokeAssignmentHandler(TaskMgmtInstance.java:141)
       ... 43 more
      Caused by: java.lang.RuntimeException: file 'classes/br/com/glr/populis/model/workflow/common/handler/PessoaAssignmentHandler.class' not found in db
       at org.jbpm.file.def.FileDefinition.getByteArray(FileDefinition.java:184)
       at org.jbpm.file.def.FileDefinition.getBytesFromDb(FileDefinition.java:176)
       at org.jbpm.file.def.FileDefinition.getBytes(FileDefinition.java:157)
       ... 48 more
      


      and this class is located in a EJB project and the jbpm jar is located in the application server lib directory.

      My question is: Why jbpm put "classes" string at the begin of the class name? And if exists an alterante config to tell to jbpm to load classes using its own name?

      i'm not using the class inside the .par archieve, couse i dont need it versioned and so more reasons!

      i need to use the class inside the ejb!

      how could i do this work fine?

      Thanks

        • 1. Re: Classloader problem
          Ronald van Kuijk Master

          sounds like a normal classloader issue. A class on the classpath (jbpm) can not find classes in the ejbjar. This is not jBPM specific.

          jBPM has it's own (versioned) classloader that appends classes to it if it tries to find the classes in the db. So this has nothing to do with your problem.

          If you need to use classes in an ejb, write a small assignmenthandler that takes a jndi name as a parameter and tries to look up the class via jndi.

          • 2. Re: Classloader problem
            Marcos Donato Newbie

            okay! understood, but what about the string "classes" that jbpm appends to the name of the class?

            why?

            and if i create an assingment class , where may i put it to be loaded sucessfully ?