I'm having a problem relating to dependencies between my web projects in an ear application. I am using jboss-4.0.2
I have two web projects, one of which depends on a spring bean that gets created when the other is loaded.
in my application.xml I have something like this:
Where webapp2 is reliant on a bean created in an applicationContext.xml file in webapp1. I assumed that putting one after the other in the application.xml file would force one to load before the other but I guess this must not be the case. Does anyone know how jboss determines the order in which it loads the web modules within an application? To me it seems completely arbitrary, I cant work it out.
Or better yet is there something I can put within the <module> node that outlines the dependencies of the current module?
I would have expected that to work - the module declared first would be loaded first. If that's not working, then create a jboss-app.xml and place it in the EAR/META-INF folder. The contents of the jboss-app.xml can be:
In the end I resolved the problem by correctly updating the class paths in the <context-param> block in the web.xml file.
However, I did find from looking in my logs that even after adding the jboss-app.xml file the web apps were loading in alphabetical order. In fact it would load the expanded .war projects first in alphabetical order and then the compressed .war files in alphabetical order. This might just be a quirk of our application because it is quite complicated, but if not, I find it quite strange that jboss does not load the web apps in the order outlined in the application.xml.
Just wanted to say I had the same issue of Jboss not following the order given in the application.xml, however adding the jboss-app.xml in the META-INF dir of the ear as suggested by Jaikiran fixed the issue.