0

I have 2 applications in the same Tomcat (8.0.14) instance. Both war files contain the same jar file, but of different versions. As I see both applications use the jar file from the second application. I thought that tomcat provides different classloaders for the 2 applications. Unfortunately I could not find any documentation explaining this issue. Is it a bug or expected behaviror?

Jars are located

APP1
  WEB-INF
    LIB
      lib-version1.jar

APP2
  WEB-INF
    LIB
      lib-version2.jar

Update: The classloading worked pefectly. The issue I experienced and seemed to be a classloading problem was cause by something else

HamoriZ
  • 2,370
  • 18
  • 38

1 Answers1

3

Tomcat do have different ClassLoaders for applications, to be precise:

    Bootstrap
        |
     System
        |
     Common
     /     \
Webapp1   Webapp2 ... 

Source: Tomcat documentation

Maybe you have put your classes into $CATALINA_HOME/lib, which is loaded by the Common ClassLoader, and this causes this.

meskobalazs
  • 15,741
  • 2
  • 40
  • 63