Axis和Log4j一塊兒使用時,出現異常org.apache.axis.ConfigurationException

調用成功,可是出現異常 出現異常:org.apache.axis.ConfigurationException: No service named  is available org.apache.axis.ConfigurationException: No service named  is available
 
 
Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this: 

throw
newConfigurationException("No service named"+ serviceName +" is available");
 
According to the  documentation linked to by @arnonym, this exception is somewhat misleading. In the first attempt to find the service a ConfigurationException is thrown and caught. It is logged at DEBUG level by the ConfigurationException class. Then another attempt is made using a different method to find the service that may then succeed. The workaround for this is to just change the log level on the ConfigurationException class to INFO in your log4j.properties:
 
log4j.logger.org.apache.axis.ConfigurationException= INFO
 
我採用的第二種方法,加上以後沒有再打印異常信息了。
 
相關文章
相關標籤/搜索