简体   繁体   中英

Order of classloading in JBoss 6.4: Is WEB-INF/classes or modules loaded first?

I have a property file named abc.properties in my WAR 's WEB-INF/classes . Also, I have placed it inside a (correctly registered) module. When I then call:

ResourceBundle.getBundle("abc")

which file would be picked?

In our production environment, the file placed inside the WAR is being picked ( consistently ) but in the UAT environment (with the same version of JBoss), its the property file in the module that is getting picked ( consistently )

Is there a defined order in which resources are loaded into classpath by JBoss, or does this happen randomly? (We haven't observed any randomness though.)

(The module is correctly registered in the production server, as other resources, namely the ojdbc jar placed in the module are getting loaded correctly)

This is our module.xml in the registered module

<module xmlns="urn:jboss:module:1.0" name="com.oracle">
  <resources>
    <resource-root path="ojdbc6.jar"/>
    <resource-root path="properties"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
  </dependencies>
</module>

abc.properties is placed inside the properties folder as defined in the above module

PS: I understand that its a wrong practice to have two property files of the same name placed in such a manner, but I want to know why am I seeing such a behaviour.

您可以查看有关EAP 6.4的类加载优先级的官方文档

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM