1. 程式人生 > >axis呼叫webservice報錯,org.apache.axis.ConfigurationException: No service named *** is available

axis呼叫webservice報錯,org.apache.axis.ConfigurationException: No service named *** is available

在使用axis呼叫webservice的時候報這個錯誤,org.apache.axis.ConfigurationException: No service named XX is available。

解決辦法,只治標不治本。解決該問題的辦法是,將這個異常的日誌級別提高到INFO,在自己的LOG4J配置檔案中新增如下配置:log4j.xml 
<logger name="org.apache.axis.ConfigurationException"> 
<level value="INFO" /> 
</logger> 
或 
log4j.properties 
log4j.logger.org.apache.axis.ConfigurationException = INFO 


下面是網友也遇到這個問題。

Hi,  
  
Not sure if you got you answer as yet but anyhow, I thought below details would help all folks who are having same problem.  
  
This is logged because this code in AxisEngine (line 308 in Axis 1.x):   
  
depends on an exception being thrown on the first attempt (line 311) to then try a different method of finding the service (which succeeds if you see no log of the AxisFault on line 316). The log entry is created because a ConfigurationException logs itself (at DEBUG level) on creation (questionable practice, imho). To avoid this misleading log entry you'll want to add this to your log4j.properties file:  
  
log4j.logger.org.apache.axis.ConfigurationException = INFO  
  
Details can be found at the following link :  
http://wiki.apache.org/ws/FrontPage/Axis/DealingWithCommonExceptions  
  
Thanks,  
Josh