求指点:myeclipse+axis2发布最简单的webservice 报错
先在此麻烦各位高手了,本人初学webservice,上网看了发布webservice的一个实例,跟着做,是用 tomcat6.0+myeclipse6.0+axis2发布最简单的SayHello,但是打包aar文件之后,部署在service当中就报错了 在http://localhost:8080/axis2/services下,
Faulty Services
d:\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF\services\my_service.aar
打开链接报错信息如下:
Error: org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of A ClassNotFoundException error occurred in loading the message receiver org.example.www.sayhello.SayHelloMessageReceiverInOut at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:147) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:79) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:582) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:201) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:271) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:189) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:110) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:257) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:74) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:486) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:406) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 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:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of A ClassNotFoundException error occurred in loading the message receiver org.example.www.sayhello.SayHelloMessageReceiverInOut at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:103) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:106) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:140) ... 36 more Caused by: org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of A ClassNotFoundException error occurred in loading the message receiver org.example.www.sayhello.SayHelloMessageReceiverInOut at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:381) at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:98) ... 38 more Caused by: org.apache.axis2.deployment.DeploymentException: A ClassNotFoundException error occurred in loading the message receiver org.example.www.sayhello.SayHelloMessageReceiverInOut at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:193) at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:169) at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:237) ... 39 more Caused by: java.lang.ClassNotFoundException: org.example.www.sayhello.SayHelloMessageReceiverInOut at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.axis2.util.Loader.loadClass(Loader.java:253) at org.apache.axis2.util.Loader.loadClass(Loader.java:224) at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:189) ... 41 more
[解决办法]
将aar文件复制到tomcat/webapps/axis2/WEB-INF/services目录下。
启动tomcat将会看到所发布的服务:HelloService、OtherService
IE输入http://127.0.0.1:8080/axis2/services/listServices
这是摘自 我找的一个文档 上面这么写的 axis2/WEB-INF/services这个路径不是自己手工创建的 是有一个axis2-1.4.1.war的文件 把他 放tomcat 路径下 然后启动tomcat 自动生成的axis2/WEB-INF/services这个文件路径 然后把.aar文件放里面 IE输入http://127.0.0.1:8080/axis2/services/listServices
看看是不是能解决你的问题吧