[jboss-jira] [JBoss JIRA] (WFLY-3262) WebServiceRef injection without explicit wsdl file fails during Servlet initialization
R Searls (JIRA)
issues at jboss.org
Thu Oct 23 11:44:35 EDT 2014
[ https://issues.jboss.org/browse/WFLY-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014654#comment-13014654 ]
R Searls commented on WFLY-3262:
--------------------------------
The fundamental problem is that a servlet object is created for ServletLoadOnStartup
and EJB3Bean. ServletLoadOnStartup is dependent on (servlet) EJB3Bean. ServletLoadOnStartup is defined explicitly by the user. EJB3Bean is defined by WildFly as class org.jboss.wsf.spi.deployment.WSFServlet. The user explicitly sets annotation @WebServlet attributes. WildFly class org.jboss.wsf.spi.deployment.WSFServlet does not use annotation @WebServlet, nor set related attributes. The setting of ServletLoadOnStartup's WebServlet attribute loadOnStartup = 1 causes this class to be started before the EJB3Bean servlet, hence this failure.
It is unclear if intelligence needs to be added to WildFly to detect this dependency
relationship and set WSFServlet attributes in accordance with the (parent) or to document this as expected behavior.
> 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: R Searls
> 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).
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the jboss-jira
mailing list