devxlogo

Classloader Diffculties with JBoss

Classloader Diffculties with JBoss

When you deploy two Web applications as Web archives (WARs) into JBoss’ deploy folder, you expect them to run independently of each other. But this does not happen.

WebApp1.war  + WEB-INF     + lib        + abc_v1.0.jar     + classes        + com.abc.Class_v1.0WebApp2.war  + WEB-INF     + lib        + abc_v1.1.jar     + classes        + com.abc.Class_v1.1

If you deploy the two Web applications in the above structure, one of them will break. This is because JBoss/Tomcat5 classloading mechanism’s class loader is used by all applications?even when they are in different WAR files.

The solution is to change the deployjbossweb-tomcat50.sarMETA-INFjboss-service.xml file. If you change the UseJBossWebLoader attribute to false, a different classloader will be used for different WAR files.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist