Search code examples
web-servicesjakarta-eeglassfishglassfish-3

How to know which web service method has been throwing an exception in GlassFish?


The following error message appears in the log file. My web service publishes many methods and this stack trace doesn't show which one was invoked when this exception occurred. There are too many clients consuming this web service and I can't tell them what content they are sending in the incorrect type and in which exactly method they are doing it.

Is it possible to configure GlassFish in some way that I could know what web service methods was called when this exception was thrown?

[#|2013-03-27T14:13:20.910-0300|SEVERE|glassfish3.1.2|com.sun.xml.ws.transport.http.HttpAdapter|_ThreadID=27;_ThreadName=Thread-2;|Unsupported Content-Type: text/xml; charset="utf-8" Supported ones are: [application/soap+xml]
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/xml; charset="utf-8" Supported ones are: [application/soap+xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:315)
at com.sun.xml.ws.encoding.StreamSOAP12Codec.decode(StreamSOAP12Codec.java:102)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:149)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:343)
at com.sun.xml.ws.transport.http.HttpAdapter.access$400(HttpAdapter.java:99)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:623)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]

Solution

  • Actually the answer to the qustion "What WS method has been called?" is "None". When this exception occurs, no webservice method has yet been invoked (on the server side), because it failed beforehand while trying to parse the request.

    Regarding your comment about appending "?wsdl" to the service parameter: "xxx/CentralWebService" probably refers to your service endpoint, while "xxx/CentralWebService?wsdl" gives you the WSDL. Its a common convention to get the WSDL by appending "?wsdl" to the service endpoint, but they are totally different things. Don't mix them up. The service constructor takes a WSDL-URL, from which it extracts the service endpoint. The latter can be overridden on the port via property BindingProvider.ENDPOINT_ADDRESS_PROPERTY.