Question

My Mule application uses a java class which is started as a Spring Bean. This works fine. But I have a problem when I undeploy my application and deploy a newer version.

After I undeploy the application the java process is still active. After deploying the new version of the application, there are two instances of the java class running.

As a solution I have added a shutdown hook to the java class. The hook works, but only when I shutdown Mule itself. Not when I undeploy the app.

To test this I have done the following:

  • Deploy application and undeploy it.
  • Check in log for message of shutdown java process, nothing found.
  • Deploy the application again.
  • Stop Mule and check log. Now there are two entries about the shutdown of the java process.

What should I do to stop the java process when I undeploy the application?

Thanks, Jeroen

I am using Mule 3.4.0 and jdk1.7.0_25.

Was it helpful?

Solution

Add a stop method on your class and call it via Spring's destroy-method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top