我是Java Web服务的新手。我准备了一个.aar文件,并使用axis2将其部署在tomcat5.5.35中。
现在,在运行Web服务时,我发现了一个奇怪的错误
org.apache.axis2.dataretrieval.DataRetrievalException: Failed to load from file, META-INF/ServiceData.xml
我不知道背后的原因。我的.aar文件包含列出服务的services.xml。但是,为什么Axis尝试加载该ServiceData.xml文件。我正在使用axis2的jdk1.6和tomcat5.5。
完整的错误日志如下
org.apache.axis2.dataretrieval.DataRetrievalException: Failed to load from file, META-INF/ServiceData.xml at org.apache.axis2.dataretrieval.DataRetrievalUtil.buildOM(DataRetrievalUtil.java:64) at org.apache.axis2.dataretrieval.AxisDataLocatorImpl.loadServiceData(AxisDataLocatorImpl.java:103) at org.apache.axis2.description.AxisService.getDefaultDataLocator(AxisService.java:2281) at org.apache.axis2.description.AxisService.getDataLocator(AxisService.java:2265) at org.apache.axis2.description.AxisService.getData(AxisService.java:2184) at org.apache.axis2.description.AxisService.getWSDL(AxisService.java:1139) at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1077) at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:280) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:229) at javax.servlet.http.HttpServlet.service(HttpServlet.java:627) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1303) at java.lang.Thread.run(Thread.java:662) Caused by: javax.xml.stream.XMLStreamException: File does not exist in the Service Repository! File=META-INF/ServiceData.xml at org.apache.axis2.dataretrieval.DataRetrievalUtil.getInputStream(DataRetrievalUtil.java:103) at org.apache.axis2.dataretrieval.DataRetrievalUtil.buildOM(DataRetrievalUtil.java:60) ... 22 more 16:20:23,031 DEBUG StAXUtils:263 - XMLStreamReader is org.apache.axiom.util.stax.dialect.WoodstoxStreamReaderWrapper 16:20:23,046 DEBUG StAXUtils:263 - XMLStreamReader is org.apache.axiom.util.stax.dialect.WoodstoxStreamReaderWrapper 16:20:23,046 DEBUG StAXUtils:680 - About to create XMLOutputFactory implementation with classloader=WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@4aa0ce
如果有人可以帮助我解决这个问题,那就太好了。
Axis2检查服务元数据文件“ avax.xml.stream.XMLStreamException:服务存储库中不存在该文件!File = META- INF / ServiceData.xml”。您的服务.aar文件夹结构正确吗?
在您的* .AAr文件中,您应该具有META_INF文件和您的实现。
test.aar|-----META_INF | |......folder contains classes