2 Replies Latest reply on Dec 1, 2005 4:04 AM by Tran Lap

    ActionHandler - new class

    Tran Lap Newbie

      I trying to create new object with ActionHandler event:
      In processdefinition.xml:

      <task-node name="test">
       <task swimlane="st">
       <event type="task-create">
       <action class="jbpm.Create"/>
       </event>
      ...

      I have 2 class
      Create class:
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      
      public class Create implements ActionHandler {
      
       private static final long serialVersionUID = 1L;
      
       public void execute(ExecutionContext executionContext) throws Exception {
       System.out.println("=======");
       ListData list;
       list = new ListData("test");
       System.out.println("=======");
       String dt = list.getName();
       executionContext.setVariable("lt", list);
       executionContext.setVariable("dt", dt);
       }
      }

      ListData class:
      public class ListData{
       private String name;
      
       public ListData(){}
      
       public ListData(String name){
       System.out.println("=========="+name+"======");
       this.name=name;
       }
      
       public void setName(String name){
       this.name=name;
       }
      
       public String getName(){
       return this.name;
       }
      
       public String toString(){
       return name;
       }
      }


      I deploy OK, when i run have this error:
      14:42:40,500 INFO [STDOUT] =======
      14:42:40,500 ERROR [GraphElement] action threw exception: couldn't get value for file 'classes/softech/jbpm/ListData.clas
      java.lang.RuntimeException: couldn't get value for file 'classes/softech/jbpm/ListData.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:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at softech.jbpm.Create.execute(Create.java:13)
       at org.jbpm.graph.def.Action.execute(Action.java:95)
       at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:186)
       at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:149)
       at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:133)
       at org.jbpm.taskmgmt.exe.TaskInstance.create(TaskInstance.java:210)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:102)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$FastClassByCGLIB$$e1d53490.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$EnhancerByCGLIB$$13a7b02c.createTaskInstance(<generated>)
       at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:146)
       at org.jbpm.graph.def.Node.enter(Node.java:298)
       at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$17a2c776.enter(<generated>)
       at org.jbpm.graph.def.Transition.take(Transition.java:92)
       at org.jbpm.graph.def.Node.leave(Node.java:364)
       at org.jbpm.graph.node.StartState.leave(StartState.java:49)
       at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$17a2c776.leave(<generated>)
       at org.jbpm.graph.exe.Token.signal(Token.java:140)
       at org.jbpm.graph.exe.Token.signal(Token.java:94)
       at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
       at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$a8732f0a.signal(<generated>)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:459)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:376)
       at org.jbpm.taskmgmt.exe.TaskInstance$$FastClassByCGLIB$$cb2c21af.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:136)
       at org.jbpm.taskmgmt.exe.TaskInstance$$EnhancerByCGLIB$$c05c40cb.end(<generated>)
       at org.jbpm.webapp.bean.TaskBean.saveAndClose(TaskBean.java:156)
       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:585)
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:25)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.PersistenceFilter.doFilter(PersistenceFilter.java:28)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.ContextFilter.doFilter(ContextFilter.java:19)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: file 'classes/softech/jbpm/ListData.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)
       ... 84 more
      14:42:40,640 DEBUG [PersistenceContext] rolling back transaction
      14:42:40,640 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
      javax.faces.FacesException: Error calling action method of component with id taskform:transitionButton
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
      .....
      


      Why? Please help me.
      Thanks.