我使用Spring的ContextLoaderListener来初始化一个Web服务客户端,但是如果wsdl文档在应用程序启动过程中不可用,那么我的应用程序的一部分被破坏,我不知道如何解决它。应用程序启动成功,只需在该点记录一个大的ol栈跟踪。唯一的例外是:如何在Spring ContextLoaderListener中捕获/更正异常?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myWebService' defined in class path resource [spring-myapp-jaxws.xml]: Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: The following WSDL exception occurred... etc.
几个问题...
- 我能赶上在init例外,这样我可以在我的应用程序适当地显示损坏的元件的状态?
- 我可以告诉Spring尝试在用户请求上重新初始化myWebService bean吗?
我考虑延迟初始化的WS豆,决定了反对它不能解决问题 - 当用户第一次尝试使用WSDL可能不可用它。 Re:创建一个代理 - 你的意思是创建一些东西来包装Web服务bean来执行异常处理,如果服务没有被正确引用,则尝试重新初始化?关于代理的 – Brabster 2010-08-23 09:20:31
- 是的。 – Bozho 2010-08-23 11:45:46