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 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 configured my pom file to use maven-embedded-glassfish-plugin. In fact this is the
I have a multi-module Maven project that makes use of WAR overlays (stack of
I have an EJB JAR + JSF WAR that runs fine on local GlassFish
I have a war module that is being built and is including a few
I have a maven3 webapp (war) project that has 2 dependencies. One is a
I have multiple (8) WAR files and 1 EAR file that I want to
I have the css-validator.war file provided by W3C running locally on JBoss . I
I have a war that also needs to serve jsp 's from alternative external
I use tomcat-maven-plugin to deploy my war to a server. What I have to
Good morning I'm running Hudson java -jar hudson.war and I have configured MSBuild as

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.