Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
cannot be cast to org.jbpm.graph.def.ActionHandler Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • cannot be cast to org.jbpm.graph.def.ActionHandler


    I have a very simple handler that gets invoked when the timer fires.

    Handler code:
    import org.jbpm.graph.def.ActionHandler;
    import org.jbpm.graph.exe.ExecutionContext;
    public class OrderLockHandler implements ActionHandler {
            private static final long serialVersionUID = 1L;
    	public void execute(ExecutionContext executionContext) throws Exception
                  System.out.println("Inside OrderLockHandler::execute()");
    This handler is inside a jar. I don't really know what is the proper way to deploy jars to the jboss server, so I copy this jar to
    C:\jboss\jbpm-jpdl-3.2.3\server\server\jbpm\lib directory and start the server.

    I create an instance of the process and when the timer fires, I receive the following exception:

    Caused by: java.lang.ClassCastException: cannot be cast to org.jbpm.graph.def.ActionHandler
            at org.jbpm.graph.def.Action.execute(
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(
            at java.lang.reflect.Method.invoke(
            at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(
            at org.jbpm.graph.def.Action_$$_javassist_34.execute(Action_$$
            at org.jbpm.graph.def.GraphElement.executeAction(
    My only guess was to check that the version of jbpm-jpdl.jar in jboss is the same as the one I linked against in my handler jar. They were the same.

    Thanks for any help

  • #2
    In cases where you get class cast exceptions using ActionHandler
    or Action, you should try to use delegation instead of casting.

    For example:

    Node node = new Node("x");
    Event event = new Event(Event.EVENTTYPE_x);
    Delegation delegation = new Delegation("x.ActionHander");
    Action action = new Action(delegation);