Application Platform 10.3 | Developing with Application Platform in Designer | About Developing Web Applications for Integration Server | Class Loading in WmAppPlat
 
Class Loading in WmAppPlat
The following diagram displays how classes are loaded for web applications, running on WmAppPlat. From top to bottom, the OSGi host bundle (org.apache.catalina) is extended by a set of fragment bundles, including the pls-web-is bundle, which are parent to the Tomcat WebAppClassLoader, which is parent to your web applications.
class loading in WmAppPlat
The following table describes each classloader:
Classloader
Description
OSGi host bundle
This classloader is created for the org.apache.catalina bundle.
fragment bundles
A composite set of fragment bundles extends the complete classpath of the OSGi host bundle. The pls-web-is bundle is part of this bundle set.
org.apache.catalina.loader.
WebappClassLoader
This classloader is parent to the deployed web applications.
webappN
Each web application has its own classloader, which resolves resources in its context.
Fragment bundles have the following declaration in the manifest.mf file: Fragment-Host: org.apache.catalina. You can share third-party libraries across your web applications by creating a wrapper bundle with this declaration. This will ensure that any code that is executed in the OSGi host bundle or any fragment bundle will have access to the package imports and exports.
Defining a Custom Classloader
To define a custom classloader add a </Loader> Tomcat configuration element to the context.xml file of your WAR project, or to the context.xml file of a Tomcat server.
The following example shows how you can add a custom </Loader> element to use the Integration Server ServerClassLoader to resolve classes from shared Integration Server locations:
<Loader className="org.apache.catalina.loader.WebappLoader"
   delegate="false" reloadable="false"
   loaderClass="com.softwareag.applatform.pls.is.web.ISWebAppClassLoader" />
For more information about using the Integration Server ServerClassLoader, see webMethods Integration Server Administrator’s Guide.