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 6914405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:20:36+00:00 2026-05-27T09:20:36+00:00

a war packaged for a tomcat webapp contains WEB-INF/classes and WEB-INF/lib/*.jar which of them

  • 0

a war packaged for a tomcat webapp contains WEB-INF/classes and WEB-INF/lib/*.jar

which of them has higher priority in the CLASSPATH?

the reason I’m asking is, that my application uses A.jar, which contains aspects generated from an aspectj project; and B.jar, which are to be woven with the aspects from A.jar.
when the project myapp is compiled, it generates many Classes which override those same classes from B.jar, these are packaged into the WEB-INF/classes dir. so if tomcat load WEB-INF/lib/*.jar first, then the woven aspects won’t take effect

  • 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-27T09:20:36+00:00Added an answer on May 27, 2026 at 9:20 am

    Tomcat has several documents on the class loader:

    • high-level: The Loader Component (https://tomcat.apache.org/tomcat-5.5-doc/config/loader.html)
    • details: Class Loader HOW-TO (https://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html)

    Quote from http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html:
    (line breaks added for readability)

    As mentioned above, the web application class loader diverges from the default Java 2 delegation model (in accordance with the recommendations in the Servlet Specification, version 2.3, section 9.7.2 Web Application Classloader).

    When a request to load a class from the web application’s WebappX class loader is processed, this class loader will look in the local repositories first, instead of delegating before looking.
    There are exceptions. Classes which are part of the JRE base classes cannot be overriden. For some classes (such as the XML parser components in J2SE 1.4+), the J2SE 1.4 endorsed feature can be used (see the common classloader definition above).

    Last, any JAR containing servlet API classes will be ignored by the classloader.

    All other class loaders in Tomcat 5 follow the usual delegation pattern.

    Therefore, from the perspective of a web application, class or resource loading looks in the following repositories, in this order:

    • Bootstrap classes of your JVM
    • System class loader classes (described above)
    • /WEB-INF/classes of your web application
    • /WEB-INF/lib/*.jar of your web application
    • $CATALINA_HOME/common/classes
    • $CATALINA_HOME/common/endorsed/*.jar
    • $CATALINA_HOME/common/i18n/*.jar
    • $CATALINA_HOME/common/lib/*.jar
    • $CATALINA_BASE/shared/classes
    • $CATALINA_BASE/shared/lib/*.jar

    So WEB-INF/classes is searched first before WEB-INF/lib.

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

Sidebar

Related Questions

We're deploying a WAR file into Tomcat 5.5 and it works fine if WEB-INF\classes
I have an application which is packaged as a .war file. It has GWT
we have a WAR packaged web application which works on a development machine. It
I have an .ear file which contains multiple war files. I am moving the
Is there anyone who has succeeded in making a self-contained .war file using Tomcat
Under WEB-INF/classes folder i have java class files structured in package hierarchy(e.g: com.company.app )
I have a Spring framework based Java web application, which has been built in
I have a Maven project which is a web project and is packaged as
I have a JAR that suddenly needs to be re-packaged as a WAR (don't
Suppose I have a war and jar projects defined in maven. The Jar project

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.