Hi Please try writing to response.getOutputStream() and it should work. I missed overriding response.getWriter() in the HttpResponse context implementation.
let me know please if it works Sergey Parimal Dhinoja wrote: > > Hi, > > I have implemented RESTful CXF service with my spring project. in impl > class, I have used MessageContext to retrieve HttpResponse and I am using > response.getWriter() to set HttpResponse with my content. > > when I call this service from browser, I get the response what I have set > in > impl, but on tomcat console, I am getting following exception. Please > help. > this is the last piece of work I have left to finish my task. > > 16-Nov-2009 13:47:31 org.apache.cxf.phase.PhaseInterceptorChain > doIntercept > WARNING: Interceptor has thrown exception, unwinding now > java.lang.IllegalStateException: getWriter() has already been called for > this response > at > org.apache.catalina.connector.Response.getOutputStream(Response.java:579) > at > org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:183) > at > javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102) > at > org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:482) > at > org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.onFirstWrite(AbstractHTTPDestination.java:546) > at > org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:61) > at > com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter.write(UTF8OutputStreamWriter.java:94) > > -- > Regards, > Parimal > "Nothing is stationary,Change is a part of Life" > > -- View this message in context: http://old.nabble.com/Exception-%3A-getWriter%28%29-has-already-been-called-for-this-response-tp26378624p26379082.html Sent from the cxf-user mailing list archive at Nabble.com.
