Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Common jars with multiple ears

 
chicha sonu
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two Ears
MyApp1.ear
--MyApp1.war
--WEB-INF
--classes
--abc.properties
--def.properties
--META-INF
--Application.xml
--MANIFEST.MF



MyApp2.ear
--MyApp2.war
--WEB-INF
--classes
--xyz.properties
--ghi.properties
--META-INF
--Application.xml
--MANIFEST.MF




Both my ears need some common jars like
log4j.jar
common-beanunitls.jar
commons-lang.jar
commons-logging.jar
quartz.jar
emorphz.jar
itext.jar
bcmail-pro.jar
jasper-fonts.jar


If i pleace all the above required jars in my ear ,my ear size would grow big in size.
Earlier i used to deploy in Jboss 4.x and JBoss 5.1 where i userd to place all the requires jars as well as application relation proerty files in $JBOSS_HOME/profile/lib/


I am newbie to JBOSS-AS 7.1


Could someoneplease help me out with this.....


Thanks in advance..
 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, and welcome to Java Ranch!

I'm not the big JBoss expert around here, but I believe modules are the new concept that replaces lib jars. Some of the jars you listed are included as modules out of the box, and at most you will just have to update the extensions section your standalone.xml configuration file (if you are running a single server). For the others, you can create your own modules.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg is correct, JBoss AS7 and WildFly (the new name of JBoss AS) uses module classloaders. By default, some modules are shipped out of the box. If you have some specific jars that you want to share between applications then you can create a module for it and add a dependency on that module from your application.

See the documentation here for details:

https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7
https://docs.jboss.org/author/display/MODULES/Home
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic