Axis2发布问题,跪求大神帮忙,真的找不到原因啊!
我在项目中的com.federal.server包下面写了一个FileService类,然后我新建了一个FileService的文件夹,里面新建了com\federal\server,把编译好的FileService.class放到了这个目录下,在WEB-INF文件夹,把services.xml放到额这个文件夹下,然后我用cmd命令生成FileService.aar,我把这个aar放到tomcat的axis2的services下面时,一直报错。
我的services.xml文件如下
<service name="FileService">
<description>
FileService 例子
</description>
<parameter name="ServiceClass">
com.federal.server.FileService
</parameter>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
</service>
报的错误信息如下:
org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:151)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:81)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71)
at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:148)
... 12 more
[ERROR] The FileService.aar service, which is not valid, caused The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:151)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:81)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71)
at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:148)
... 12 more
[INFO] org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
求指点啊,折腾一天了都,求指点!
[解决办法]
org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\apache-tomcat-6.0.35\webapps\axis2\WEB-INF\services\FileService.aar
根据以上异常信息 应该是 你打包成.aar 文件的时候 所需类或配置文件没有全部打包好,axis2去需找service.xml的时候 在你指定的.arr 文件当中找不到!
建议使用Axis2的 tool : axis2-eclipse-service-plugin-1.6.2 (这是Axis2 最新版本的插件)生成arr文件。