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
Loading service beans for ActionHandler Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading service beans for ActionHandler

    I'm fairly new to jbpm and I'm trying to run a custom ActionHandler that invokes service-layer beans.

    I have two questions:

    1. What is the correct way of loading service-layer beans for my ActionHandler and where do I store them?

    Right now, my handler looks like this:

    public class OrderLockHandler implements ActionHandler {
        private static final long serialVersionUID = 1L;
        private BPMService bpmService = null;
        private static ApplicationContext applicationContext = null;
    	public void execute(ExecutionContext executionContext) throws Exception
                    applicationContext = new ClassPathXmlApplicationContext("jbpm-hander-applicationContext.xml");
    		 long orderId = (Long)executionContext.getVariable("orderId");
                    bpmService = (BPMService)applicationContext.getBean("BPMService");
    I basically package and deploy the applicationContext and service jar along with process definition to JBoss and hope that it finds them.

    This sucks in many ways and it doesn't feel right, so I'm hoping there is a correct way of doing this that I don't know.

    2. What is the right way of deploying jars to Jboss server?

    Currently, I deploy using Eclipse and I'm forced to add service-layer jars as dependencies to the project where my process definition lives, just so it shows up in the deployment window. Is there a better way to deploy jars to Jboss server?

    I tried copying them to server/lib folder, but when I do that, it throws an exception "Cannot cast OrderLockHandler to ActionHandler"

    I would appreciate any guidance in my jbpm journey here. Thanks

    What I run on:
    JBoss 4.2.2 GA
    spring-modules-jbpm31 v0.8-20070311155753