Anbu
Anbu

Reputation: 3

Class cast Exception while trying to deploy the Modules in axis 2 : OS: Linux , Tomcat Version:8

When I am trying to start the tomcat, at the time of deploying the axis2 modules , I am getting class cast exception.

I have enabled the EnableChildfirstClassLoading property. When I checked the classloading(using -verbose), some of the classes are getting loaded twice.
e.g. [Loaded org.apache.axis2.engine.MessageReceiver from file:/irv_test/cipsm/SecureLinkTestingNEW/SLInstaller1/app4.0/tomcat/webapps/axis2/WEB-INF/lib/axis2-kernel-1.6.2.jar]

This class is loaded twice from the same jar location.

Axis Version: 1.6.2
Tomcat: 8
OS: Redhat Linux

Here is the trace:

[ERROR] The soapmonitor-1.6.2.mar module, which is not valid, caused org.apache.axis2.handlers.soapmonitor.SOAPMonitorModule cannot be cast to org.apache.axis2.modules.Module org.apache.axis2.deployment.DeploymentException: org.apache.axis2.handlers.soapmonitor.SOAPMonitorModule cannot be cast to org.apache.axis2.modules.Module at org.apache.axis2.deployment.repository.util.ArchiveReader.readModuleArchive(ArchiveReader.java:527) at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:77) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:813) at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:69) at org.apache.axis2.deployment.RepositoryListener.(RepositoryListener.java:64) at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:158) at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:228) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454) at org.apache.axis2.webapp.AxisAdminServlet.init(AxisAdminServlet.java:60) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.axis2.deployment.DeploymentException: org.apache.axis2.handlers.soapmonitor.SOAPMonitorModule cannot be cast to org.apache.axis2.modules.Module at org.apache.axis2.deployment.ModuleBuilder.populateModule(ModuleBuilder.java:233) at org.apache.axis2.deployment.repository.util.ArchiveReader.readModuleArchive(ArchiveReader.java:514) ... 31 more Caused by: org.apache.axis2.deployment.DeploymentException: org.apache.axis2.handlers.soapmonitor.SOAPMonitorModule cannot be cast to org.apache.axis2.modules.Module at org.apache.axis2.deployment.ModuleBuilder.loadModuleClass(ModuleBuilder.java:86) at org.apache.axis2.deployment.ModuleBuilder.populateModule(ModuleBuilder.java:121) ... 32 more Caused by: java.lang.ClassCastException: org.apache.axis2.handlers.soapmonitor.SOAPMonitorModule cannot be cast to org.apache.axis2.modules.Module at org.apache.axis2.deployment.ModuleBuilder$1.run(ModuleBuilder.java:76) at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132) at org.apache.axis2.deployment.ModuleBuilder.loadModuleClass(ModuleBuilder.java:74) ... 33 more`

Upvotes: 0

Views: 2539

Answers (1)

Andreas Veithen
Andreas Veithen

Reputation: 9154

EnableChildFirstClassLoading is broken in Axis2 1.6.2 and 1.6.3. See AXIS2-5720.

Upvotes: 0

Related Questions