How to share classes and resources among different applications in JBoss

Source: Internet
Author: User
Tags jboss tomcat

How to share classes and resources among different applications in JBoss: Typically, if you want to share classes and resources between different applications of JBoss, we should put classes and resources under jboss/server/default/lib/so that all applications can share resources;

In JBoss, if the classes and resources are in a different war package and want to share the resources in Web-inf/classes and Web-inf/lib in the war package between different applications, what can you do?

Can pass jbossweb-tomcat-55.sar/meta-inf/ Jboss-service.xml configuration file Usejbosswebloader To resolve the problem, simply set this property to True: Indicates that Tomcat uses the uniform ClassLoader as a Web application ClassLoader This means that the war package is Web-inf Classes in the/classes and Web-inf/lib directories are loaded into the default shared class loader warehouse. It enables classes and resources to be shared between Web applications. However, if this is not what you want, you can avoid this behavior by setting this property to False.

< attribute name= "Usejbosswebloader" > True </attribute >

This situation should generally be avoided because there is a conflict between different applications when the same classes and resources are in use in different applications, for example:

Two war application Wara,warb have com.liuxiang.a.class files below;

Now expect each war package to be under separate a.class files, and when modifying a Wara application, Tomcat will redeploy the following applications. At this time, there will be Wara applications using Warb below the A.class, causing confusion.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.