This documentation is for WSO2 Application Server 5.2.1. View documentation for the latest release.
Page Comparison - Webapp ClassLoading (v.2 vs v.3) - Application Server 5.2.1 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagehtml/xml
<Classloading xmlns="http://wso2.org/projects/as/classloading">
   <Environments>CXF<Environments>Spring,Carbon</Environments>
</Classloading>

...

  1. Modify the webapp-classloading-environments.xmlfile with the following entries.

    Code Block
    languagehtml/xml
    <ExclusiveEnvironments> 
       <ExclusiveEnvironment> 
          <Name>Spring</Name> 
          <Classpath>${carbon.home}/lib/runtimes/spring/*.jar;${carbon.home}/lib/runtimes/spring/</Classpath> 
       </ExclusiveEnvironment> 
    </ExclusiveEnvironments>
  2. Next, create and copy of the related Spring dependencies in the <PRODUCT_HOME>/lib/runtimes/spring directory.
  3. Add the following entries to the webapp-classloading.xml file of each web application, to use them in the Spring runtime environment defined above.

    Code Block
    languagehtml/xml
    <Classloading xmlns="http://wso2.org/projects/as/classloading">
       <Environments>CXF,Carbon</Environments>
    </Classloading>
     
Info

Note that adding custom runtime environments to your system without studying their impact can cause unfavorable results. For example, assume an Application Server (AS) instance contains the following configurations.

  • CXF (runtime provided by AS) contains CXF 2.7.5 and Spring 3.0.7 dependencies.

  • Spring (custom runtime) contains Spring 3.2.1 dependencies.

If a web application consumes both of the above environments, the following problems will arise:

  1. The web application's classpath contains dependencies from two Spring versions as 3.0.7 and 3.2.0. The Spring project does not recommend this as it will cause several classloading issues.

  2. CXF 2.7.5 itself uses Spring 3.0.7. It is possible that a particular CXF version is not properly tested for compliance with another version of Spring. You should study the CXF project recommendations to find a suitable Spring version.

...