cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Hagen" <>
Subject Exceptions in cxf on HTTP HEAD requests to wsdls
Date Tue, 19 Jun 2012 13:11:18 GMT

we've been using CXF (currently 2.1.3, soon 2.5.4) on the server side for some time now (in
Tomcat 6.0 with Spring 3.0 if that is of any interest).

We have one client that - for whatever reason - performs HTTP HEAD-Requests to the WSDL-Urls
(http://.../services/Endpoint?wsdl) before performing it's calls.

We only recently noticed that those calls fail under certain circumstances with cxf 2.1.3
due to an exception "org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader."
in the class ReadHeadersInterceptor (See below for full stacktrace). From what we've been
able to discern so far, the problem seems to be reproducable only when the server has been
just started and no HTTP GET requests have been made to the WSDL URL yet. Once the first HTTP
GET to that URL has been sent, subsequent HTTP HEAD Requests succeed.

With CXF 2.5.4 those Exceptions are easier to reproduce - they are thrown every time an HTTP
HEAD request is sent to one of the WSDLs, regardless whether a HTTP GET has previously been

After stepping through the CXF 2.5.4 code I would guess that the problem is in WSDLGetInterceptor
- for GET requests the interceptor performs it's work and finishes with a call to "message.getInterceptorChain().abort();",
for HEAD requests it returns immediatedly without that call to abort() which causes the ReadHeadersInterceptor
to be called, which then promptly fails.

Is this a bug in CXF or a configuration issue? If it is a bug is there a way to work around
this? (Other than changing the clients so they don't send HTTP Head requests)

Best Regards


This is the stacktrace logged by CXF:

org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
	at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(
	at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
	at org.apache.cxf.transport.servlet.ServletDestination.invoke(
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(
	at org.apache.cxf.transport.servlet.ServletController.invoke(
	at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(
	at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(
	at javax.servlet.http.HttpServlet.doHead(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.ApplicationDispatcher.invoke(
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(
	at org.apache.catalina.core.ApplicationDispatcher.doForward(
	at org.apache.catalina.core.ApplicationDispatcher.forward(
	at de.konsens.gda.server.ServiceUrlRewriteFilter.forwardToBasePath(
	at de.konsens.gda.server.ServiceUrlRewriteFilter.doFilter(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
	at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(
	... 31 more
Daniel Hagen
Tel: 0179/6953843

View raw message