]
Alessio Soldano updated WFLY-3262:
----------------------------------
Fix Version/s: 9.0.0.CR1
WebServiceRef injection without explicit wsdl file fails during
Servlet initialization
--------------------------------------------------------------------------------------
Key: WFLY-3262
URL:
https://issues.jboss.org/browse/WFLY-3262
Project: WildFly
Issue Type: Bug
Components: Web Services
Affects Versions: 8.1.0.CR1
Reporter: Matus Abaffy
Assignee: Alessio Soldano
Fix For: 9.0.0.CR1
Reproducer test available at
https://github.com/bafco/wildfly/commits/wsServletInjection
I have the following servlet
{code}
@WebServlet(/*..., */ loadOnStartup = 1)
public class ServletLoadOnStartup extends HttpServlet {
@WebServiceRef(value = EndpointService.class)
private EndpointInterface endpoint1;
//...
{code}
(It is located in the package org.jboss.as.test.integration.ws.serviceref. There you can
find more info about the other classes.)
And i get the following exception:
{code}
org.jboss.arquillian.container.spi.client.container.DeploymentException: Cannot deploy:
ws-servlet-test.war
...
Caused by: java.lang.Exception: {"JBAS014671: Failed services" =>
{"jboss.undertow.deployment.default-server.default-host./ws-servlet-test" =>
"org.jboss.msc.service.StartException in service
jboss.undertow.deployment.default-server.default-host./ws-servlet-test:
javax.servlet.ServletException: UT010013: Could not instantiate ServletLoadOnStartup
Caused by: javax.servlet.ServletException: UT010013: Could not instantiate
ServletLoadOnStartup
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component
instance
Caused by: java.lang.RuntimeException: JBAS011875: Resource lookup for injection
failed: env/org.jboss.as.test.integration.ws.serviceref.ServletLoadOnStartup/endpoint1
Caused by: javax.naming.NamingException: JBAS011878: Failed to lookup
env/org.jboss.as.test.integration.ws.serviceref.ServletLoadOnStartup/endpoint1 [Root
exception is org.jboss.wsf.spi.WSFException: Cannot create service]
Caused by: org.jboss.wsf.spi.WSFException: Cannot create service
Caused by: java.lang.reflect.InvocationTargetException
Caused by: javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
parsing 'http://localhost:8080/ws-servlet-test/EndpointService/EJB3Bean?wsdl'.:
java.io.FileNotFoundException:
http://localhost:8080/ws-servlet-test/EndpointService/EJB3Bean?wsdl
Caused by: java.io.FileNotFoundException:
http://localhost:8080/ws-servlet-test/EndpointService/EJB3Bean?wsdl"}}
{code}
If I change loadOnStartup parameter to -1, everything works fine, i.e. servlet gets
instantiated and WS is injected correctly. Therefore, I suppose this is a bug.
Another workaround exists - adding wsdl file to the deployment archive and using the
'wsdlLocation' parameter in @WebServiceRef (as can be seen in
ServiceRefSevletTestCase).