cxf webservice客户端和服务端报错

问题描述

cxf webservice客户端和服务端报错

服务端报错:
Caused by: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Connection reset by peer

org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.
at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:288)
at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:270)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:104)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:323)
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:205)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
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:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:941)
at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:279)
... 40 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl$ElementStack.pop(XMLStreamWriterImpl.java:1976)
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:916)
... 41 more

客户端报:
org.apache.cxf.interceptor.Fault: Unmarshalling Error: ParseError at [row,col]:[1,68437]
Message: Premature EOF
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:791)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:632)
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:156)
at org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:178)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:762)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1582)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1467)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1375)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:623)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:510)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:295)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy34.hquery(Unknown Source)
at DCC.client.WebServiceThread.queryWebserviceSend(WebServiceThread.java:83)
at DCC.client.WebServiceThread.run(WebServiceThread.java:240)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.xml.bind.UnmarshalException

  • with linked exception:

Message: Premature EOF]
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:357)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:334)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:768)
... 24 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,68437]
Message: Premature EOF
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:596)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:182)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:355)
... 26 more

解决方案

CXF创建webservice客户端和服务端
CXF创建webservice客户端和服务端
CXF创建webservice客户端和服务端

解决方案二:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,68437]
Message: Premature EOF

很显然,是你的XML配置文件有语法错误。

解决方案三:

估计是读写数据时,arraylist 的下标有异常

时间: 2025-01-20 22:10:29

cxf webservice客户端和服务端报错的相关文章

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

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

CXF创建webservice客户端和服务端

一.CXF的介绍 Apache CXF是一个开源的WebService框架,CXF大大简化了Webservice的创建,同时它继承了XFire的传统,一样可以和spring天然的进行无缝的集成.CXF框架是一种基于servlet技术的SOA应用开发框架,要正常运用基于CXF应用框架开发的企业应用,除了CXF应用本身之外,还需要JDK和servlet容器的支持. 二.CXF的准备条件 所需要的jar包:   xmlbeans-2.4.0.jar   wss4j-1.5.9.jar   jetty-

Netty学习4—NIO服务端报错:远程主机强迫关闭了一个现有的连接

1 发现问题 NIO编程中服务端会出现报错 Exception in thread "main" java.io.IOException: 远程主机强迫关闭了一个现有的连接. at sun.nio.ch.SocketDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25) at sun.nio.ch.IOUtil.readIntoNativeBuffer(I

java 开发Webservice客户端获取服务端数据存入本地数据库

问题描述 之前没有接触过webService现在需要写个webService的客户端去获取服务端的数据,然后再存入到本机的数据库中,不知道该如何实现这个是开发的报表功能,现在报表的数据是本机自己建的表,但实际的数据要从别的几个系统中取出,再存入本机的数据库,所以想请问下实现过程是什么,谢谢 解决方案 解决方案二:可以用cxf或者axis2生成客户端.然后客户端里再实现数据的插入操作解决方案三:找个axis根据wsdl直接生成客户端,生成的客户端里面会带有接口的本地存根,这时就相当于调用本地的接口

eclipse根据WSDL生成客户端,再生成服务端报错, JAX-RPC 1.1 specification

does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly. 纯洁化实体BEAN即可,注释掉代码   public static org.apache.axis.encoding.Serializer getSerializer(            java.lang.String mechType,       

jms 客户端SSL连MQ本地服务端报错

问题描述 MQJE001:完成代码为'2',原因为'2396'.com.ibm.msg.client.jms.DetailedJMSException:JMSFMQ6312:JavaMQI中发生异常.JavaMQI已抛出描述该问题的异常.请参阅链接的异常以获取进一步的信息.atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl

io流-socket 客户端读取服务端发送的 序列化流 报错

问题描述 socket 客户端读取服务端发送的 序列化流 报错 客户端 服务端 请大神指教,实在找不到原因了,对这块儿也不是很熟 解决方案 socket调用了一次getInputStream时,但又需要把这个socket的相关信息作为参数传递给别的对象时,应注意:不用直接把socket传过去,应该把对应的ObjectInputStream或ObjectOutputStream对象传递过去. 解决方案二: 直接读写Object,使用java自己的序列化不可以吗?

cxf net-java cxf调用.net的服务端,报类型不匹配

问题描述 java cxf调用.net的服务端,报类型不匹配 我有一个wsdl的地址,可以根据这个地址,使用cxf生成对应的java po文件. 但是在使用cxf的动态调用的使用,总是报类型不匹配. 这是我的代码 public static void main(String[] args) { // TODO Auto-generated method stub cn.com.webxml.AuthenticationInformation authenticationInformation =

java-关于多个不同的Ip客户端调用同一个webservice方法,服务端进行用户会话数据区分

问题描述 关于多个不同的Ip客户端调用同一个webservice方法,服务端进行用户会话数据区分 目前在写一个webservice供外部进行调用,由于要进行身份的验证,所以我在webservice的服务端加如了拦截器(客户将自己的信息写在soapHead消息中),然后在拦截器中取出soapHead中的消息,进行数据库用户信息的验证,验证通过之后才运行进行相关接口的调用.问题是在拦截器验证通过后,我要在调用的webservice接口方法中,?用到用户的身份信息去取其他相关数据.该怎么做呢? 开始我