Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8932571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:20:35+00:00 2026-06-15T09:20:35+00:00

I don’t know how to structure my ear file in my context. Here is

  • 0

I don’t know how to structure my ear file in my context.

Here is my actual structure:

ear
--lib
--war1
--war2
--warA
--warB

In ear/lib, I have all common jars between wars. Everything works fine but my ear is heavy.

In fact, war1 and war2 share some jars. WarA and warB too.

I don’t put these jars in ear/lib because warA/B don’t use everything and war1/2 too.

Today, war1/2 come with every jars, so some jars are in double.

I would like to have something like this:

ear
--lib (common jars)
--war1
--war2
--something who comes with common jars for war1/2
--warA
--warB
--something who comes with common jars for warA/B

Like this, war1 and war2 will be lighter. Same thing for warA and war B.

Do you know if I can do that and what kind of archive I can use to do that ? jar, war, sar ? I’m on Jboss 5.1

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:20:38+00:00Added an answer on June 15, 2026 at 9:20 am

    So the PROBLEM is: you’ve an ear with two sets of wars: each set use a different version of the same library (so the version used by the first set must be isolated from the second, and viceversa), and you don’t want to have to place the same library several times in different places of the ear. A part of these libraries, you may have other libraries shared by all the modules.

    Possible SOLUTION:
    You could add a new war for each of the sets, those will just contain the libraries shared by the rest of wars in the same set. Then,to make it work without classloading problems you should isolate each set by placing a jboss-classloading.xml conveniently configured in each of the wars WEB-INF directory, and in the META-INF/jboss-classloading.xml of the ear which keeps the wars.

    So the structure would be something like:

    yourapp.ear
        |
        |--lib
        |    |- place here the libraries shared by all the wars in the ear
        |
        |--META-INF
        |     |
        |     |-jboss-classloading.xml
        |
        |--war1SetA.war
        |     |
        |     |-WEB-INF
        |           |- jboss-classloading.xml    
        |           |
        |           |- classes
        |      
        |     
        |--war2SetA.war
        |     |
        |     |-WEB-INF
        |           |- jboss-classloading.xml    
        |           |
        |           |- classes
        |      
        |      
        |--libsSetA.war
        |     |
        |     |-WEB-INF
        |           |- jboss-classloading.xml    
        |           |
        |           |- lib
        |                |-Place here the libraries used by wars of setA
        |       
        |--war1SetB.war
        |     |
        |     |-WEB-INF
        |           |- jboss-classloading.xml    
        |           |
        |           |- classes
        |     
        |--war2SetB.war
        |     |
        |     |-WEB-INF
        |           |- jboss-classloading.xml    
        |           |
        |           |- classes
        |     
        |--libsSetB.war
              |
              |-WEB-INF
                    |- jboss-classloading.xml    
                    |
                    |- lib
                         |-Place here the libraries used by wars of setB
    

    The wars named libsSet* are used just to keep the libraries used by the wars of the same set.

    The jboss-classloading.xml of the wars in set A should be similar to:

    <classloading xmlns="urn:jboss:classloading:1.0"
        domain="SetA"
        export-all="NON_EMPTY"
        import-all="true"
        parent-domain="yourapp.ear"
        parent-first="false">
    </classloading>
    

    And for wars in set B, it should be:

    <classloading xmlns="urn:jboss:classloading:1.0"
        domain="SetB"
        export-all="NON_EMPTY"
        import-all="true"
        parent-domain="yourapp.ear"
        parent-first="false">
    </classloading>
    

    IMPORTANT: the domain attribute must be the same for all the wars in the same set.

    And finally the META-INF/jboss-classloading.xml in the ear file should be:

    <classloading xmlns="urn:jboss:classloading:1.0"
       domain="yourapp.ear"
       export-all="NON_EMPTY"
       import-all="true"
       parent-first="false">
    </classloading>
    

    Another possible solution, similar to this one, would be placing the shared libraries of each set in one of the wars of the set, this way you wouldn’t need a war just for libraries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

don't know better title for this, but here's my code. I have class user
Don't know if I'm missing something here. I'd like to run multiple global variables
Don't know what's wrong here, when I run the application it says Specified method
Don't know if this has been answered before. Have custom routes to users. If
Don't know why I can't reply to people on here with only a small
Don't know why but I can't find a solution to this. I have 3
Don't know the term for the red validation border, does it have one? I
Don't know a better title but here is what im trying to do. I
don't know if the title describes anything about what I'm trying to say but
Don't ask me how but I'm in a situation where I have DCPs published

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.