You can return it to the 2.2.x behavior by setting the property:
"set-jaxb-validation-event-handler" to "false"
on the endpoint.
HOWEVER, the error is correct. An empty element like that is NOT valid XML
for an integer and a service should properly reject it. With 2.2.x, we didn't
have any sort of validator set on JAXB and if JAXB could continue, it would
ignore things and continue. With 2.3, we added the validator which only
triggers on major obvious things that don't affect performance. It's not
full schema validation, but at least it flags major issues.
Dan
On Tuesday, May 03, 2011 1:03:45 AM verma_amitin wrote:
> Hi,
>
> We have one webservice deployed at our client side(Sonic ESB) earlier we
> used Apache Axis to generate client stub from WSDL at that time everything
> was working smoothly. Later on we migrated our libraries to CXF 2.2.3 to
> generate client stub even then things were working fine but just recently
> we upgraded cxf-2.2.3 to cxf-2.3.3 and we got below mentioned exception
> while calling the webservice which return a response containing empty
> integer xml element.
>
> 2011-04-13 11:34:17,430 WARN [org.apache.cxf.phase.PhaseInterceptorChain]
> Interceptor for
> {http://plc.com/schemas/PlcObjectModel}PolicyServiceService#{http://plc.com
> /schemas/PlcObjectModel}GetPolicyImage has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unmarshalling Error: Zero length
> BigInteger at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:7
> 91) at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:6
> 32) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:133)
> at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
> lInInterceptor.java:198) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:255) at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> seInternal(HTTPConduit.java:2335) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
> e(HTTPConduit.java:2193) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
> duit.java:2037) at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputSt
> ream.java:47) at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:697)
>
>
> Problem identified
> we have one empty element (int type[<IterationNumber/>) in the
> response coming from the
> webservice which is causing the issue(we have tested after
> removing this element and things work
> perfectly fine).
>
> My Query
> I am having one question why same response is working with
> cxf-2.2.3 and not with cxf-2.3.3 and
> please also let me know how to resolve this issue in cxf-2.3.3.
>
>
>
>
> Thanks in advance.
>
> Regards, Amit
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/JAXB-issue-with-cxf-2-3-3-jar-tp4366378p43
> 66378.html Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com