Question

I have guvnor deployed on tomcat 7. Now need to deploy a wrapper webservice around the BRMS. The webservice is a spring-ws and uses @Autowired kbase dependency injection. kbase is configured in spring-context XML as (not literal):

<drools:resource id="xxx" source="http://localhost:8080/guvnor/.../<package>/LATEST

Now the problem is tomcat first loads the webservice which fails to initialize as the guvnor URL is not up yet.

I can work around this by first starting only guvnor along with tomcat startup and then copy the WS war to the webapps folder. This works but is painful to do everytime.

What is the best approach?

I have seen this thread, but not sure if it will work in this context: Is there a way to enforce a deployment order in tomcat6?

Was it helpful?

Solution

Tried the following ways to address this:

  1. Tomcat brings up both services on starup. The initialization of webservice fails but bring up the webservice manually through tomcate admin interface.
  2. Use a script to do the same as above to bring up the webservice after a delay.
  3. Change the drools package initialization to load through drools API instead of through config files along with a retry logic.

All of these work, but retaining the last option in the production code.

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