Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

Application.xml Module loading order

 
Luke Foxton
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
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:

 
Luke Foxton
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mats, welcome to Java Ranch, but please do not wake the zombies.
 
    Bookmark Topic Watch Topic
  • New Topic