I use Spring ContextLoaderListener to initialize the web services client, but if the wsdl document is not available at application startup, part of my application is broken and I'm not sure how to fix it. The application starts successfully, simply registering a large stack trace of the stack at that moment. The exception is:
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.
A couple of questions...
- Can I catch the init exception so that I can correctly show the state of the broken component in my application?
- Can I tell Spring to try to reinitialize myWebService bean on user request?
source
share