2 Replies Latest reply on Aug 23, 2007 5:39 AM by candersen

    NoClassDefFound

    candersen

      Hello,

      I am trying to integrate my own objects into jbpm, but I keep getting exceptions. I think its best to outline my problem:

      I created a very simple processdefiniton:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition
       xmlns="" name="objectTest">
       <start-state name="start">
       <event type="node-leave">
       <action name="action1" class="com.test.SetUpActionHandler"/>
       </event>
       <transition name="" to="node1"></transition>
       </start-state>
      
       <end-state name="end">
       </end-state>
       <node name="node1">
       <action class="com.test.ObjectTestActionHandler" />
       <transition name="" to="end"></transition>
       </node>
      </process-definition>
      


      The SetUpActionHandler adds an object of the type "TestObject" as a variable to the context instance:

      package com.test;
      
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      
      public class ObjectTestActionHandler implements ActionHandler {
      
       private static final long serialVersionUID = 1L;
      
       public void execute(ExecutionContext executionContext) throws Exception
       {
       TestObject to = new TestObject();
       to.setText("TestString");
       executionContext.getContextInstance().createVariable("Test", to);
       }
      }
      
      


      The TestObject is a very simple java object, it contains only one field, a string called "text".

      In the node in my process, I try to retrieve the TestObject from the contextInstance. This is done in the ObjectTestActionHandler:

      package com.test;
      
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      
      public class ObjectTestActionHandler implements ActionHandler {
      
       private static final long serialVersionUID = 1L;
      
       public void execute(ExecutionContext executionContext) throws Exception
       {
       TestObject to = (TestObject) executionContext.getContextInstance().getVariable("Test");
       System.out.println(to.getText());
       }
      }
      
      


      When i test this process locally, it works fine. When I deploy it to a JBoss-Server (3.2), I get an exception. The stack-trace looks like this:

      
      ava.lang.NoClassDefFoundError: com/test/TestObject
       com.test.SetUpActionHandler.execute(SetUpActionHandler.java:12)
       org.jbpm.graph.def.Action.execute(Action.java:122)
       org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:247)
       org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:215)
       org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:185)
       org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:169)
       org.jbpm.graph.def.Node.leave(Node.java:381)
       org.jbpm.graph.node.StartState.leave(StartState.java:70)
       org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
       net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
       org.jbpm.graph.def.Node$$EnhancerByCGLIB$$5a43c9d9.leave(<generated>)
       org.jbpm.graph.exe.Token.signal(Token.java:194)
       org.jbpm.graph.exe.Token.signal(Token.java:165)
       org.jbpm.webapp.bean.ProcessBean.startInstance(ProcessBean.java:162)
       org.jbpm.webapp.bean.ProcessBean$StartInstanceListener.processAction(ProcessBean.java:123)
       javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
       javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
       javax.faces.component.UICommand.broadcast(UICommand.java:368)
       javax.faces.component.UIData.broadcast(UIData.java:854)
       javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
       javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
       com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
       com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
       com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
       org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      


      Can anyone help me solve this?

      Regards

      Claus Andersen

        • 1. Sorry, wrong stack-trace
          candersen

          Sorry, the stack-trace in my first post was not the right one. This is the one I get:

          java.lang.NoClassDefFoundError
           org.jbpm.context.exe.matcher.JcrNodeMatcher.class$(JcrNodeMatcher.java:33)
           org.jbpm.context.exe.matcher.JcrNodeMatcher.matches(JcrNodeMatcher.java:33)
           org.jbpm.context.exe.JbpmType.matches(JbpmType.java:53)
           org.jbpm.context.exe.VariableInstance.createVariableInstance(VariableInstance.java:86)
           org.jbpm.context.exe.VariableInstance.create(VariableInstance.java:65)
           org.jbpm.context.exe.VariableContainer.setVariableLocally(VariableContainer.java:157)
           org.jbpm.context.exe.ContextInstance.createVariable(ContextInstance.java:72)
           org.jbpm.context.exe.ContextInstance.createVariable(ContextInstance.java:63)
           com.test.SetUpActionHandler.execute(SetUpActionHandler.java:14)
           org.jbpm.graph.def.Action.execute(Action.java:122)
           org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:247)
           org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:215)
           org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:185)
           org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:169)
           org.jbpm.graph.def.Node.leave(Node.java:381)
           org.jbpm.graph.node.StartState.leave(StartState.java:70)
           org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
           net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
           org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
           org.jbpm.graph.def.Node$$EnhancerByCGLIB$$5a43c9d9.leave(<generated>)
           org.jbpm.graph.exe.Token.signal(Token.java:194)
           org.jbpm.graph.exe.Token.signal(Token.java:165)
           org.jbpm.webapp.bean.ProcessBean.startInstance(ProcessBean.java:162)
           org.jbpm.webapp.bean.ProcessBean$StartInstanceListener.processAction(ProcessBean.java:123)
           javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
           javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
           javax.faces.component.UICommand.broadcast(UICommand.java:368)
           javax.faces.component.UIData.broadcast(UIData.java:854)
           javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
           javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
           com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
           com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
           com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
           org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          
          


          • 2. Update
            candersen

            Hi again,

            I worked on it a bit, I found out that my TestObject was not serializable. I changed the class, it implements Serializable now. That way, I got rid of the NoClassDefFoundException, but I got a new error message when I start my process.

            the web-console shows me an error: Failed to start process: com.test.TestObject cannot be cast to com.test.TestObject.

            Any ideas?