• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Two WAR files to an EAR

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
We have to create an EAR file that should have two WAR files. But these two WAR files share common application libraries. The two WAR files are build and added to EAR. When this EAR is deployed, the common classes are loaded twice resulting in duplicate schedulers. How can these common libraries be loaded only once? should they be removed from one WAR file?

Thanks in adv
 
Ranch Hand
Posts: 378
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
move those libraries at ear file level.
so both web applications can load from there.
 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply. So, should the common jars go to WEB-INF\lib of EAR file? I know EAR has a META-INF, applicatoin.xml.
 
German Gonzalez-Morris
Ranch Hand
Posts: 378
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can try leave them in the root of the ear file.
ear file doesn't have a WEB-INF, only war files.

If you are using WebLogic then the jars can go into /APP-INF/lib (this is in the root of the ear file)
 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ABC.ear
- application.xml
- meta-inf
- xyz.war
- 123.war
- common1.jar
- common2.jar

Is it this way?
 
German Gonzalez-Morris
Ranch Hand
Posts: 378
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.

anyway which app container are you using ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not create multiple threads for the same question. I'm closing the other one https://coderanch.com/t/562508/EJB-JEE/java/Two-WAR-files-have-common.
 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is for jboss. The actual problem is, there are some dao classes and quartz schedulers in those common jars. they are started when war is deployed. If they are common, when two wars are deployed, the schedulers, dao connections etc are loaded twice. I want to avoid that.

any clues?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ramu Nur wrote: I want to avoid that.

any clues?



Did you read the replies in the other thread?
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you configure your project with maven. You just need to add dependencies to your application project and maven handles everything else..
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rajesh yedula,
Your post was moved to a new topic.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic