Quantcast
Channel: Sanjeewa Malalgoda's Blog
Viewing all articles
Browse latest Browse all 220

How to avoid web application deployment faliures due to deployment listener class loading issue. - WSO2 Application Server

$
0
0
WSO2 Application server can be use to deploy web applications and services. For some advance use cases we might need to handle deployment tasks and post deployment tasks. There can be listeners defined globally in repository/conf/tomcat/web.xml to achieve this as follows.


<listener>
  <listener-class>com.test.task.handler.DeployEventGenerator</listener-class>
</listener>



When we deploy web application to WSO2 Application Server sometimes class loading environment can be changed. To fix this we can deploy the webapp with "Carbon" class loading environment. For some use cases we are shipping CXF/Spring dependencies within the web application so any class loader environment other than "CXF" might fail. 

To fix this we need to add file named webapp-classloading.xml to META-INF. Then content should be as follows.


<Classloadingxmlns="http://wso2.org/projects/as/classloading">
   <Environments>Carbon</Environments>
</Classloading>


Viewing all articles
Browse latest Browse all 220

Trending Articles