[ 
https://issues.apache.org/jira/browse/CXF-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14298858#comment-14298858
 ] 

Guillaume Grossetie commented on CXF-6231:
------------------------------------------

I found the following line in one of our interceptor:

{code:java}
message.getExchange().put(StaxOutInterceptor.FORCE_START_DOCUMENT, 
Boolean.TRUE);
{code}

This was the root of the issue... sorry about that, I hope you didn't waste too 
many time :)

> Getting the wsdl from a cxf webservice throws an exception
> ----------------------------------------------------------
>
>                 Key: CXF-6231
>                 URL: https://issues.apache.org/jira/browse/CXF-6231
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.7.14
>            Reporter: Guillaume Grossetie
>
> Hi,
> We've updated CXF from 2.6.2 to 2.7.14 and we are experiencing this issue. 
> When using WSDLGetOutInterceptor we get the following exception:
> {code}Can not output XML declaration, after other output has already been 
> done.{code}
> {code}
> org.apache.cxf.interceptor.Fault: Can not output XML declaration, after other 
> output has already been done.
>       at 
> org.apache.cxf.frontend.WSDLGetOutInterceptor.handleMessage(WSDLGetOutInterceptor.java:61)
>       at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>       at 
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>       at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>       at 
> org.apache.cxf.phase.PhaseInterceptorChain.doInterceptStartingAt(PhaseInterceptorChain.java:424)
>       at 
> org.apache.cxf.frontend.WSDLGetInterceptor.handleMessage(WSDLGetInterceptor.java:97)
>       at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
>       at 
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>       at 
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)
>       at 
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)
>       at 
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)
>       at 
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)
>       at 
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
>       at 
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
>       at 
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>       at 
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
>       at 
> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
>       at 
> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
>       at 
> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
>       at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
>       at 
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
>       at 
> weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
>       at 
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
>       at 
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
>       at 
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
>       at 
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
>       at 
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
>       at 
> weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
>       at 
> weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
>       at 
> weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
>       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
>       at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
> Caused by: javax.xml.stream.XMLStreamException: Can not output XML 
> declaration, after other output has already been done.
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1537)
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1566)
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:646)
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:634)
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:622)
>       at org.apache.cxf.staxutils.StaxUtils.writeDocument(StaxUtils.java:888)
>       at 
> org.apache.cxf.frontend.WSDLGetOutInterceptor.handleMessage(WSDLGetOutInterceptor.java:56)
>       ... 32 more
> {code}
> I think this regression was introduced in: 
> https://github.com/apache/cxf/commit/e0d4f15fd6f1b4352c189442e5f2902303bcd5cb
> Thanks



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to