• Post Reply Bookmark Topic Watch Topic
  • New Topic

Two WAR files to an EAR  RSS feed

 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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
 
German Gonzalez-Morris
Ranch Hand
Posts: 284
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 284
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 284
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.

anyway which app container are you using ?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not create multiple threads for the same question. I'm closing the other one http://www.coderanch.com/t/562508/EJB-JEE/java/Two-WAR-files-have-common.
 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramu Nur wrote: I want to avoid that.

any clues?


Did you read the replies in the other thread?
 
Andrew Moko
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • 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: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rajesh yedula,
Your post was moved to a new topic.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!