[
https://issues.apache.org/jira/browse/CXF-5620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13936109#comment-13936109
]
gary diao edited comment on CXF-5620 at 3/15/14 10:05 AM:
----------------------------------------------------------
I try to monitor the net communication between browser and server. found that
when browser request for the service list, it launch two request:
http://localhost:8080/ub/websvc/ ## service list page
http://localhost:8080/ub/websvc//?stylesheet=1 ## for stylesheet request
the second request cause the exception backend:
at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.renderStyleSheet(ServiceListGeneratorServlet.java:174)
at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.service(ServiceListGeneratorServlet.java:89)
After investigation found the in ServiceListGeneratorServlet class, it use
getWriter() and getOutputStream() at the same time.
Line:86 PrintWriter writer = response.getWriter();
Line:174 IOUtils.copy(url.openStream(), response.getOutputStream());
I remember that these methods should not be used in this way.
was (Author: gdiao):
I try to monitor the net communication between browser and server. found that
when browser request for the service list, it launch two request:
http://localhost:8080/ub/websvc/ ## service list page
http://localhost:8080/ub/websvc//?stylesheet=1 ## for stylesheet request
the second request cause the exception backend:
at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.renderStyleSheet(ServiceListGeneratorServlet.java:174)
at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.service(ServiceListGeneratorServlet.java:89)
After investigation found the in ServiceListGeneratorServlet class, it use
getWriter() and getOutputStream() at the same time.
Line:86 PrintWriter writer = response.getWriter();
Line:174 IOUtils.copy(url.openStream(), response.getOutputStream());
I remember that this two methods are not allowed use in this way.
> Exception when try to generate the service list of deployed services
> --------------------------------------------------------------------
>
> Key: CXF-5620
> URL: https://issues.apache.org/jira/browse/CXF-5620
> Project: CXF
> Issue Type: Bug
> Components: WS-* Components
> Affects Versions: 2.7.10
> Environment: Tomcat 6/7.0
> Reporter: gary diao
> Priority: Minor
>
> When try to access the service list get following error:
> Mar 15, 2014 5:43:42 PM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet CXFServlet threw exception
> java.lang.IllegalStateException: getWriter() has already been called for this
> response
> at
> org.apache.catalina.connector.Response.getOutputStream(Response.java:580)
> at
> org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:183)
> at
> org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.renderStyleSheet(ServiceListGeneratorServlet.java:174)
> at
> org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.service(ServiceListGeneratorServlet.java:89)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:170)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)
> 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:617)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
> at java.lang.Thread.run(Thread.java:662)
--
This message was sent by Atlassian JIRA
(v6.2#6252)