In Websphere, it is possible to create a "Shared Libraries" and associate with applications. I would want to know, in terms of position in classpath, what's the position of the shared libs are added? That means, I want to know, in case of duplicated resources, which will have higher "priority" to be loaded, Shared Libraries or the EAR/WAR itself.
For example, assume in my application, I have a resources called appConfig.xml, and I am creating a local directory in the app server, putting another appConfig.xml in that directory. If I tries to load the resources (e.g. open input stream) in my app, which file will be loaded?
I have searched for a while and can find nowhere mentioning this. Though I can try it out by myself by experimenting, I would want to know the official expected behavior, if any.
Thanks a lot
The ordering amongst class loaders uses the so-called "class loader mode", which is either "parent first" (and application classes/resources last) or "parent last" (with application classes/resources first). For a single application class loader, the class path ordering will be:
There is no configuration option to change the ordering. I do not think this ordering is explicitly state in documentation, but I also think it's highly unlikely to change. Regardless, I would not recommend relying on it. I would recommend ensuring you use unique resource/class names within a single class loader.
I think here: http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Fcrun_classload.html you'll find everything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With