• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding order of loading the jar files

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

This may be a very rudimentary question...
But a wierd issue that I am facing in my project

I am using RAD-WS8.5 in my application.
My application has 3 jar files in one EAR file
I want each jar to be loaded in a specific order and not randomly.
By chance, got to notice that when I changed the order in the application.xml file, the loading was perfectly fine.
When I reversed the order, the loading failed because the dependant jar was not getting loaded first.

Primarily my question(s) is/are
1. What should be done to load the jar files in specific order in websphere8.5?
2. What is the role of application.xml in this loading sequence?

Thanks!

Regards,
Sriram
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know, WAS classloader should be able to load any required classes in ear library list, no matter what their relative order is. Why do you need a specific ordering? I have sometimes read about someone willing to use different versions of a library, so that he or she relies upon jar loading order. Despite the fact that is actually possible, IMHO that is not a good practice...
 
Sriram Sharma
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh yeah... I also read about that.
However, in my case it is not about different versions.
Following is the exact replica of my project.

Parent.ear has 3 jars in it (Each jar is specific to different applications (project))
- Child1.jar
- Child2.jar
- Child3.jar

Child 1 has to load first and then only Child2 has to load.
What happens currently is that Child2 is getting loaded first and one of the fikles in it is expecting a dependency file present in Child1.jar
I tried adding a MANIFEST.MF to the Parent.ear's META-INF folder and specifying the order of loading that I want to happen.
But that did not work either.

Regards,
Sriram
 
Sriram Sharma
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Just replying back to my own question hoping that this helps someone in search of similar stuff...
Add an entry <initialize-in-order>true</initialize-in-order> in the deployment descriptor like application.xml
Then place each module to be loaded in the order in which we want to have them loaded.

This resolves the issue.
BEWARE: This is applicable since J2EE version 6 and above

Thanks!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic