Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No ClassDefFound Error in Axis2

 
Krishnan Sreeraman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends

I am new to web services. I got NoClassDefFound Error while deploying the web service in . I am trying to access some classes defined in the jar file which i have included in the axis2 archive (.aar) file. But when i tried to deploy the service I got the following Error message in the Tomcat Console


at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.<init>(
DefaultSchemaGenerator.java:115)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:340
)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui
lder.java:347)
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServic
eGroup(ArchiveReader.java:95)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServ
iceGroup(ArchiveReader.java:137)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.ja
va:78)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy
(DeploymentFileData.java:137)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngin
e.java:571)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoL
ist.java:141)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListe
ner.java:318)
at org.apache.axis2.deployment.RepositoryListener.checkServices(Reposito
ryListener.java:220)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentE
ngine.java:118)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(War
BasedAxisConfigurator.java:272)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurat
ionContext(ConfigurationContextFactory.java:78)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisSer
vlet.java:500)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:420
)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:96
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:74
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720
)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
48)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

Please help me resolve this out.

Thanks in advance

Regards
Krishnan Sreeraman
 
Krishnan Sreeraman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I missed out some of the error message while copying hence i am posting the error message again

[INFO] The MySample service, which is not valid, caused java.lang.No
ClassDefFoundError: com/krish/MyException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.<init>(
DefaultSchemaGenerator.java:115)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:340
)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui
lder.java:347)
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServic
eGroup(ArchiveReader.java:95)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServ
iceGroup(ArchiveReader.java:137)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.ja
va:78)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy
(DeploymentFileData.java:137)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngin
e.java:571)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoL
ist.java:141)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListe
ner.java:318)
at org.apache.axis2.deployment.RepositoryListener.checkServices(Reposito
ryListener.java:220)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentE
ngine.java:118)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(War
BasedAxisConfigurator.java:272)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurat
ionContext(ConfigurationContextFactory.java:78)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisSer
vlet.java:500)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:420
)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:96
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:74
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720
)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
48)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
 
Krishnan Sreeraman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I missed out some of the error message while copying hence I am again posting the error message.

[INFO] The MySample service, which is not valid, caused java.lang.No
ClassDefFoundError: com/krish/MyException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.<init>(
DefaultSchemaGenerator.java:115)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:340
)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui
lder.java:347)
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServic
eGroup(ArchiveReader.java:95)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServ
iceGroup(ArchiveReader.java:137)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.ja
va:78)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy
(DeploymentFileData.java:137)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngin
e.java:571)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoL
ist.java:141)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListe
ner.java:318)
at org.apache.axis2.deployment.RepositoryListener.checkServices(Reposito
ryListener.java:220)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentE
ngine.java:118)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(War
BasedAxisConfigurator.java:272)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurat
ionContext(ConfigurationContextFactory.java:78)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisSer
vlet.java:500)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:420
)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:96
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:74
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720
)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
48)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So where is class "com.krish.MyException"? Axis obviously can't find it.
 
Krishnan Sreeraman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is in the jar file MyJar.jar which defines the MyException class. And I have included the MyJar in the .aar file. but still it says NoClassDefFound Error

Thanks
Krishnan Sreeraman
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you certain that .aar files can contain .jar files (as opposed to a hierarchy of .class files)? I would be surprised if that's possible.
 
Krishnan Sreeraman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if I am right can you suggest me some ways to access the MyException class in MyJar.jar file.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, I don't think that's possible. Try packaging the aar file with a loose hierarchy of class files instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic