cxf 调用webservice 报getOutputStream() has already been called for this response

问题描述

cxf 调用webservice 报getOutputStream() has already been called for this response

简单演示了下cxf,如下:
@WebService
public interface HelloWordService {

String sayHello(@WebParam String name);

}

public class HelloWordServiceImpl implements HelloWordService {

@Override
public String sayHello(String name) {
    return "hello,"+name;
}

}

public class CXFNonSpringServletImpl extends CXFNonSpringServlet {

/**
 *
 */
private static final long serialVersionUID = -2963437387304529373L;

@Override
public void loadBus(ServletConfig sc) {
    super.loadBus(sc);

    Object helloWordServiceImpl=new HelloWordServiceImpl();
    String helloWordServiceAddress="/helloWordService";
    Endpoint.publish(helloWordServiceAddress, helloWordServiceImpl);

}

}

竟然报这个异常,火大!!
异常如下:
2014-4-1 12:24:37 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet CXFServlet threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:611)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:112)
at com.wave.webservice.core.CXFNonSpringServletImpl.invoke(CXFNonSpringServletImpl.java:41)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
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.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:186)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:103)
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:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

解决方案

是不 是内 存 溢出了?

时间: 2024-12-27 16:02:26

cxf 调用webservice 报getOutputStream() has already been called for this response的相关文章

web service-jboss5环境下,cxf调用webservice不返回内容,也不报错

问题描述 jboss5环境下,cxf调用webservice不返回内容,也不报错 有谁碰到过这种情况,cxf调用webservice在jar包运行下没问题, 换到jboss5下面就会有问题,但是不报错,也不返回任何东西 解决方案 http://www.iteye.com/problems/47007 解决方案二: 我是直接调用的客户端,不用任何配置的

android-Android调用webservice报错空指针异常

问题描述 Android调用webservice报错空指针异常 #test2(String name) 输入一个String类型 返回hello+name的Demo

spring cxf 创建webservice 报无方法

问题描述 spring cxf 创建webservice 报无方法 spring cxf 创建webservice 报无方法,但是在测试工具下没有问题,求解

ocket xception-android开发,调用webservice报错,求指导一下,感激不尽

问题描述 android开发,调用webservice报错,求指导一下,感激不尽 java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) 解决方案 网络问题,检查下通讯,ip端口等等.

php调用webservice报错Class 'SoapClient' not found

原文:php调用webservice报错Class 'SoapClient' not found       php在调用webservice时,报告如下类似错误:            ( ! ) Fatal error: Class 'SoapClient' not found in E:/WebSrv/CI/system/libraries/WebService.php on line 17       解决方法:    打开php.ini,找到php_soap.dll , 把前面的分号去

调用webservice报错====

问题描述 java.lang.NoSuchMethodException:com.tydic.smpin.intf.imp.BillDataSvrImp.BillInfo([Lcom.tydic.smpin.intf.vo.BillReqVo;,null)atorg.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)atorg.apache.axis.message.SOAPFaultBuilde

web service-java调用webservice时报 faultString: (404)Not Found

问题描述 java调用webservice时报 faultString: (404)Not Found ******* request ******* <?xml version="1.0" encoding="GBK"?> ESSESS0025AEGON_WS_ESS_USER_LOGIN 02014-05-13 13:57:01 1926099983abcde Exception in thread "main" AxisFaul

web service-jboss5环境下,cxf和axis调用webservice客户端都是不报错,不返回结果

问题描述 jboss5环境下,cxf和axis调用webservice客户端都是不报错,不返回结果 有谁碰到过这种问题,cxf和axis调用webservice没问题,部署到jboss5里面就有问题, 不报错,不返回结果 解决方案 http://blog.csdn.net/shiqi472807092/article/details/8254494

cxf webservice-关于动态调用webservice

问题描述 关于动态调用webservice 使用CXF动态客户端调用webservice,代码如下: JaxWsDynamicClientFactory dynamicClient = JaxWsDynamicClientFactory .newInstance(); String wsdl = "http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx?wsdl"; Client client = dynamicCl