2014-06-16 52 views
0

我遇到與laalto - Axis2 error while running web service相同的問題。org.apache.axis2.dataretrieval.DataRetrievalException:無法從文件加載,META-INF/ServiceData.xml

以下情況例外,當我打電話web服務時,雖然服務似乎正常運行:

[email protected]:46:05 DEBUG DataRetrievalUtil - File does not exist in the Service Repository! File=META-INF/ServiceData.xml [http-bio-8080-exec-9] 
    [email protected]:46:05 DEBUG AxisDataLocatorImpl - Check loading failure for file, META-INF/ServiceData.xml.Message = Failed to load from file, META-INF/ServiceData.xml [http-bio-8080-exec-9] 
    [email protected]:46:05 DEBUG AxisDataLocatorImpl - Check loading failure for file, META-INF/ServiceData.xml [http-bio-8080-exec-9] 
    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:104) 
      at org.apache.axis2.description.AxisService.getDefaultDataLocator(AxisService.java:2949) 
      at org.apache.axis2.description.AxisService.getDataLocator(AxisService.java:2933) 
      at org.apache.axis2.description.AxisService.getData(AxisService.java:2850) 
      at org.apache.axis2.description.AxisService.getWSDL(AxisService.java:1545) 
      at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1355) 
      at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:198) 
      at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:258) 
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) 
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) 
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) 
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) 
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) 
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
      at java.lang.Thread.run(Thread.java:744) 
    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) 
      ... 26 more 

我的web項目是兩歲左右,自比其結構從未改變。結構是:

Webservices.war|-----axis2-web 
       |-----META-INF| 
          |------MANIFEST.MF 
       |-----WEB-INF | 
          |------web.xml 
          |------sources..... 

而且從來沒有一個名爲「ServiceData.xml」的文件。

我使用Tomcat 7.0_39和Axis2 1.5.6。 webservice組件是用Java 1.7.0_21實現的。

這個錯誤以前是否可能未經記錄? - 我使用上次部署更改了Web服務的日誌記錄行爲。

我發現一些提示將「services.xml」重命名爲「ServiceData.xml」,但這真的是一個合適的解決方案嗎?

在此先感謝!

回答

0

該解決方案爲我工作:

的例外似乎沒有任何影響,因爲在文件夾

webapps/WebServices/WEB-INF/services/WebService/META-INF 

因此,我們可以忽略這個異常的services.xml。儘管如此,例外總是表明一個錯誤,因此應該解決。

我發現了一個解決方案,這是不satifying但防止異常的發生:

複製的services.xml以上的文件夾中,並將其重命名爲ServiceData.xml。這個例外永遠不會發生!要簡單地放置一個名爲的空文件ServiceData.xml不起作用! ServiceData.xml必須包含與文件services.xml相同的信息!

這不幸是一個實際的,但不是一個好的解決方案,因爲它修復了這個異常的原因,但影響。

如果有更好的解決方案,請在這裏貢獻!