欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Illegal character (NULL, unicode 0) encountered: not valid in any content

程序员文章站 2022-06-11 08:21:30
...
org.apache.cxf.interceptor.Fault: Unmarshalling Error: Illegal character (NULL, unicode 0) encountered: not valid in any content
 at [row,col {unknown-source}]: [393,127] 
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:881)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:702)
	at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:160)
	at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:107)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:845)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1624)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1513)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1318)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
	at cn.com.venustech.webservice.cvs.impl.CvsWebserviceImpl.generalAssetResult(CvsWebserviceImpl.java:29)
	at cn.com.venustech.webservice.cvs.impl.CvsWebserviceImpl.main(CvsWebserviceImpl.java:72)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content
 at [row,col {unknown-source}]: [393,127]]
	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.doUnmarshal(JAXBEncoderDecoder.java:842)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:101)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:870)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:868)
	... 20 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character (NULL, unicode 0) encountered: not valid in any content
 at [row,col {unknown-source}]: [393,127]
	at com.ctc.wstx.sr.StreamScanner.constructNullCharException(StreamScanner.java:630)
	at com.ctc.wstx.sr.StreamScanner.throwInvalidSpace(StreamScanner.java:660)
	at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4685)
	at com.ctc.wstx.sr.BasicStreamReader.finishToken(BasicStreamReader.java:3718)
	at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3672)
	at com.ctc.wstx.sr.BasicStreamReader.getTextCharacters(BasicStreamReader.java:879)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java:313)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:177)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:355)
	... 26 more

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
	at cn.com.venustech.webservice.cvs.impl.CvsWebserviceImpl.generalAssetResult(CvsWebserviceImpl.java:36)
	at cn.com.venustech.webservice.cvs.impl.CvsWebserviceImpl.main(CvsWebserviceImpl.java:72)



调用接口报错,发现是参数中有下划线,导致的,应该是有的特殊字符都不可以需要转义或者进行编码设置
相关标签: webservice