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

  • Home
  • SEARCH
  • 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 5971773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:33:51+00:00 2026-05-22T20:33:51+00:00

I have a WAR that is configured to use a scoped classloader under JBoss.

  • 0

I have a WAR that is configured to use a scoped classloader under JBoss. This all works fine and dandy. The configuration for it in jboss-web.xml looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC
  "-//JBoss//DTD Web Application 4.2//EN"
  "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">

<jboss-web>
    <class-loading>
        <loader-repository>
            com.mycompany:loader='com.mycompany.repository'
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
    </class-loading>
</jboss-web>

Now, a client wants to deploy two copies of our WAR file under the same JBoss instance. They are configured to use the same classloader repository, which causes problems.

If I manually change jboss-web.xml inside one copy of the WAR file to specify a different repository, e.g by changing the relevant line to:

            com.mycompany:loader='com.mycompany.repository2'

…both copies of the WAR deploy without trouble.

However, hacking the internals of the WAR file isn’t a fantastic solution for a customer.

If I could incorporate, say, the context root into the name of the repository (or some other property that is guaranteed to be different between two the two deployments), this could be accomplished automatically.

Is it possible to use properties within jboss-web.xml?, letting me do something like:

            com.mycompany:loader='com.mycompany.repository-${jboss.context-root}'

(Note: I made up that property name.)

Stepping back a bit, is there a better way to accomplish what I’m trying to accomplish?

  • 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-05-22T20:33:52+00:00Added an answer on May 22, 2026 at 8:33 pm

    The normal J2EE way of achieving what you want is to separate code from deployment. This means that putting jboss-web.xml into the WAR is the mistake here.
    This deployment-specific configuration file should be used during deployment. I don’t really know the jboss deployment process, but for Oracle IAS it is the following:

    • WAR/EAR does only contain code-specific settings and declarations of env-entries, used data-sources, security-roles etc. (in web.xml), but not the values for the entries
    • At deploy time the vendor-pecific deployment descriptor (orion-web.xml for Oracle, jboss-web.xml for jBoss ) containing the mapped runtime values for the roles, datasources, env-entries etc. is passed to the container (This is done in a container specific way, Oracle takes a deployment plan file given via cmdline arg or via upload in Browser form, i.e. you upload EAR and deployment plan, deployment plan contains all vendor-specific deployment descriptors)

    The JSR 88 defines the deployment plan concept and also defines a deployment plan facility . So this should be your starting point fo looking int jboss documentation.

    As said before, this is the standard J2EE way of separating deploy-time value mappings from your code WAR/EAR.
    In your particular case you would end up with one EAR and two different deployment plans.

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

Sidebar

Related Questions

I have a web application (.war) that contains some static files (e.g. MS word
How do I create a grails war file so that it doesn't have the
Hopefully this will not spark a religious war... We have a web based app
I have a new web app that is packaged as a WAR as part
I have developed a simple application in GWT. After that, I generate war file
I have 2 different webapps (package into different war files) which needs to share
I have a simple j2ee application: foo.ear - foo.war - foo.jar (ejb3 jar) I
I have a web application that's based on Spring and the application contexts, applicationContext.xml
I want to create a web app that will use wicket, hibernate and spring
We distribute our web-application to our customers as a .war file. That way, the

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.