Search code examples
javaweb-servicesjakarta-eewsdlglassfish

FileNotFoundException for local WSDL


I try to implement a consumer for my jax-ws @Stateless @WebService bean webservice. The service runs fine and I can successfully test it using NetBeans's/GlassFish's webservice testing functionality.

The consumer is a Servlet deployed with the same ear as the service. I inject the service using

@WebServiceRef(wsdlLocation = "http://localhost:8080/EchoService/EchoBean?wsdl")
EchoService echo;

but whenever I open the servlet all I get is a stack trace with the following root exception

java.io.FileNotFoundException:
http://localhost:8080/EchoService/EchoBean/__container$publishing$subctx/null?WSDL

I can load the WSDL from http://localhost:8080/EchoService/EchoBean/?WSDL in the browser but I have no clue about the __container$publishing$subctx/null part, which is not mentioned anywhere in my code.

The full stack trace is available at http://pastebin.com/dneCPj8z

Any help would be greatly appreciated!


Solution

  • If you are using Glassfish 4, @WebServiceRef annotation does not work properly on servlets and filters. This is filed under GLASSFISH-20740. Check this thread.

    HTH