使用jaxb数据格式的apache camel中的解组错误

时间:2016-08-25 10:22:14

标签: web-services jaxb apache-camel jbossfuse

我是骆驼和jboss保险丝的新手,我正面临一个问题。我正在尝试使用 soapUI 向我的web服务发送请求。我使用了apache camel的 cxf组件和apache camel中的jaxb 。在请求中有一个标签AuthTimeStamp。

当我进入时  

 <AuthTimestamp>2009-01-02T11:13:56.745+05:30 </AuthTimestamp> 

工作正常。但是当我进入时:

 <AuthTimestamp>3-23-190017:00</AuthTimestamp>  

它给了我错误。我相信jaxb正在进行某种验证,我的请求在那里失败了。但我不会返回肥皂故障类型错误。

我希望使用适当的信息返回正确的xml。如果请求传递给我的cxf bean,那么我可以处理异常制作一个正确的错误包并返回它。之前已经提出了类似的问题,但我找不到合适的解决方案。

我的骆驼路线的初始部分:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:camel="http://camel.apache.org/schema/spring"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <!-- Service for gateway is exposed. cxfEndpoint mentioned in EsangamBeanConfig.xml-->
    <!-- <to uri="bean:NSDGPortTypeImpl"/> -->
    <!-- <simple>${body.getIISMessage()}</simple>  -->
    <!--     <to uri="bean:iISMessageProcessorID?method=logTransaction(${body})"/>
     -->

    <!--Here goes IISMessageContext(body) -->
    <!--Here goes SubmitDocument(body) -->
    <!--Here goes IISMessageContext(body) -->

    <camelContext id="eSangamMessagingCamelContext" xmlns="http://camel.apache.org/schema/spring">
        <dataFormats>
            <jaxb contextPath="in.gov.esangam.eservices.messaging" prettyPrint="true" encoding="UTF-8" id="myJaxb"/>
        </dataFormats>
        <route id="eSangam Messaging Start">
            <from uri="cxf:bean:NSDGPortType"/>
            <log message="New Request Arrived at Gateway"/>

下面是堆栈跟踪:

14:47:31,842 | WARN  | qtp1545452967-60 | PhaseInterceptorChain            | 118 - org.apache.cxf.cxf-core - 3.0.4.redhat-620133 | Interceptor for {http://www.mit.gov.in/eGov/schema/NSDG/wsdl}NSDGPortTypeService#{http://www.mit.gov.in/eGov/schema/NSDG/wsdl}processSubmitDocument has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: 3/23/19005:00:00PM 
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:908)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:176)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194)[131:org.apache.cxf.cxf-rt-wsdl:3.0.4.redhat-620133]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[89:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.Server.handle(Server.java:370)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
 - with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:483)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:417)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:858)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:897)
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_91]
    at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:895)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
    ... 40 more
Caused by: javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
 - with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:740)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:770)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:766)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.handleParseConversionException(Loader.java:275)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:69)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:589)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:338)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:216)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:185)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    ... 46 more
Caused by: javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
 - with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]
    ... 56 more
Caused by: java.lang.IllegalArgumentException: 3/23/19005:00:00PM
    at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parseYear(Unknown Source)[:]
    at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parse(Unknown Source)[:]
    at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl.<init>(Unknown Source)[:]
    at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newXMLGregorianCalendar(Unknown Source)[:]
    at com.sun.xml.bind.DatatypeConverterImpl._parseDateTime(DatatypeConverterImpl.java:378)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:279)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:277)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.FilterTransducer.parse(FilterTransducer.java:84)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:245)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:65)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
    ... 51 more
14:47:31,846 | INFO  | qtp1545452967-60 | Soap12FaultOutInterceptor        | 134 - org.apache.cxf.cxf-rt-bindings-soap - 3.0.4.redhat-620133 | class org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternalapplication/soap+xml

0 个答案:

没有答案