aspose file tools*
The moose likes JBoss/WildFly and the fly likes Application.xml Module loading order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Reply locked New topic
Author

Application.xml Module loading order

Luke Foxton
Greenhorn

Joined: Feb 09, 2009
Posts: 5
Hello,

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?

Thanks in advance for any help

Luke




Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10213
    
166

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:



[My Blog] [JavaRanch Journal]
Luke Foxton
Greenhorn

Joined: Feb 09, 2009
Posts: 5
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.

Anyway thanks for the help

Luke
mats karstad
Greenhorn

Joined: Oct 09, 2009
Posts: 1
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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

Mats, welcome to Java Ranch, but please do not wake the zombies.


JBoss In Action
 
 
subject: Application.xml Module loading order