cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Zavizionov" <alexey.zavizio...@gmail.com>
Subject Re: Interceptor has thrown exception: IllegalArgumentException in XMLGregorianCalendarImpl
Date Fri, 19 Sep 2008 15:44:45 GMT
Here attached test case

On Fri, Sep 19, 2008 at 5:22 PM, Benson Margulies <bimargulies@gmail.com>wrote:

> All things considered, a JIRA with a test case might be worthwhile,
> even if all it does it allow us to help you more efficiently.
>
> On Fri, Sep 19, 2008 at 10:19 AM, Daniel Kulp <dkulp@apache.org> wrote:
> >
> > Quick question:  what "type" is it defined in the wsdl/xsd for that
> param?
> >
> > Is it a "dateTime" or just a "date"?   The xmlbeans error implies it's
> > supposed to be a "date".   In that case, the soap message is wrong as the
> > format is for a dateTime.
> >
> > Dan
> >
> >
> >
> > On Friday 19 September 2008 4:19:25 am Alexey Zavizionov wrote:
> >> It works for JAXBDataBinding, but not for AegisDatabinding.
> >>
> >> ========================================================
> >>         JaxWsServerFactoryBean serverFactory = new
> >> JaxWsServerFactoryBean();
> >> serverFactory.getServiceFactory().setDataBinding(new
> >> JAXBDataBinding());//AegisDatabinding());
> >> ========================================================
> >>
> >> And not forXmlBeansDataBinding :
> >>
> >> ========================================================
> >> INFO: Creating Service
> >> {http://exoplatform.org/soap/xfire}TicketOrderServicefrom<http://exoplatform.org/soap/xfire%7DTicketOrderServicefrom>class
> >> org.exoplatform.services.ws.soap.jsr181.TicketOrderService
> >> Sep 19, 2008 10:16:03 AM
> >> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> >> INFO: Outbound Message
> >> ---------------------------
> >> Encoding: UTF-8
> >> Headers: {SOAPAction=["urn:GetTicket"]}
> >> Messages:
> >> Payload: <soap:Envelope xmlns:soap="
> >> http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ns2:departing
> >> xmlns:ns2="http://exoplatform.org/soap/xfire
> ">1</ns2:departing><ns2:arrivin
> >>g
> >> xmlns:ns2="http://exoplatform.org/soap/xfire
> ">2</ns2:arriving><ns2:departur
> >>eDate
> >> xmlns:ns2="http://exoplatform.org/soap/xfire
> ">2008-09-19T10:16:03.501+02:00
> >></ns2:departureDate><ns2:passenger
> >> xmlns:ns2="http://exoplatform.org/soap/xfire
> ">3</ns2:passenger></soap:Heade
> >>r><soap:Body><ns2:getTicket
> >> xmlns:ns2="http://exoplatform.org/soap/xfire
> "/></soap:Body></soap:Envelope>
> >> --------------------------------------
> >> java.lang.reflect.InvocationTargetException
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
> >>9) at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> >>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> org.apache.cxf.xmlbeans.DataReaderImpl.read(DataReaderImpl.java:99)
> >>         at
> >> org.apache.cxf.xmlbeans.DataReaderImpl.read(DataReaderImpl.java:43)
> >>         at
> >>
> org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor.handleMessage
> >>(SoapHeaderInterceptor.java:109) at
> >>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> >>n.java:220) at
> >>
> org.apache.cxf.transport.MultipleEndpointObserver.onMessage(MultipleEndpoin
> >>tObserver.java:86) at
> >>
> org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
> >>         at java.lang.Thread.run(Thread.java:595)
> >> Caused by: org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException:
> >> Invalid date value: wrong type: 2008-09-19T10:16:03.501+02:00
> >>         at
> >>
> org.apache.xmlbeans.impl.values.XmlObjectBase$ValueOutOfRangeValidationCont
> >>ext.invalid(XmlObjectBase.java:285) at
> >>
> org.apache.xmlbeans.impl.values.JavaGDateHolderEx.lex(JavaGDateHolderEx.jav
> >>a:81) at
> >>
> org.apache.xmlbeans.impl.values.JavaGDateHolderEx.set_text(JavaGDateHolderE
> >>x.java:56) at
> >>
> org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlO
> >>bjectBase.java:1135) at
> >>
> org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.jav
> >>a:1274) at
> >>
> org.apache.xmlbeans.impl.values.JavaGDateHolderEx.dateValue(JavaGDateHolder
> >>Ex.java:202) at
> >>
> org.apache.xmlbeans.impl.values.XmlObjectBase.getDateValue(XmlObjectBase.ja
> >>va:1518) ... 11 more
> >> Sep 19, 2008 10:16:03 AM org.apache.cxf.phase.PhaseInterceptorChain
> >> doIntercept
> >> INFO: Application has thrown exception, unwinding now
> >> org.apache.cxf.interceptor.Fault: argument type mismatch while invoking
> >> public abstract java.lang.String
> >>
> org.exoplatform.services.ws.soap.jsr181.TicketOrderService.getTicket(java.l
> >>ang.String,java.lang.String,java.util.Date,java.lang.String) with params
> [1,
> >> 2, <xml-fragment xmlns:ns2="
> >> http://exoplatform.org/soap/xfire" xmlns:soap="
> >> http://schemas.xmlsoap.org/soap/envelope/
> ">2008-09-19T10:16:03.501+02:00</x
> >>ml-fragment>, 3].
> >>         at
> >>
> org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.
> >>java:121) at
> >>
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
> >>113) at
> >>
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
> >>68) at
> >>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerIn
> >>terceptor.java:56) at
> >>
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.ja
> >>va:37) at
> >>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceI
> >>nvokerInterceptor.java:92) at
> >>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> >>n.java:220) at
> >>
> org.apache.cxf.transport.MultipleEndpointObserver.onMessage(MultipleEndpoin
> >>tObserver.java:86) at
> >>
> org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
> >>         at java.lang.Thread.run(Thread.java:595)
> >> Caused by: java.lang.IllegalArgumentException: argument type mismatch
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
> >>9) at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
> >>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >>
> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractIn
> >>voker.java:136) at
> >>
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:
> >>82) ... 8 more
> >> Sep 19, 2008 10:16:03 AM org.apache.cxf.interceptor.LoggingInInterceptor
> >> logging
> >> INFO: Inbound Message
> >> ----------------------------
> >> Encoding: UTF-8
> >> Headers:
> >> Messages:
> >> Message:
> >>
> >> Payload: <soap:Envelope xmlns:soap="
> >> http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Body><soap:Fault><faultcod
> >>e>soap:Server</faultcode><faultstring>argument type mismatch while
> invoking
> >> public abstract java.lang.String
> >>
> org.exoplatform.services.ws.soap.jsr181.TicketOrderService.getTicket(java.l
> >>ang.String,java.lang.String,java.util.Date,java.lang.String) with params
> [1,
> >> 2, &lt;xml-fragment xmlns:ns2="
> >> http://exoplatform.org/soap/xfire" xmlns:soap="
> >> http://schemas.xmlsoap.org/soap/envelope/
> "&gt;2008-09-19T10:16:03.501+02:00
> >>&lt;/xml-fragment&gt;,
> >> 3].</faultstring></soap:Fault></soap:Body></soap:Envelope>
> >> --------------------------------------
> >> ========================================================
> >>
> >> Someone had similar problems?
> >>
> >> Regards,
> >> Alexey
> >>
> >> On Fri, Sep 19, 2008 at 10:32 AM, Alexey Zavizionov <
> >>
> >> alexey.zavizionov@gmail.com> wrote:
> >> >         JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >> >         client.setServiceClass(TicketOrderService.class);
> >> >         client.setAddress("local://TicketOrderService");
> >> >         client.getInInterceptors().add(new LoggingInInterceptor());
> >> >         client.getOutInterceptors().add(new LoggingOutInterceptor());
> >> >
> >> >         TicketOrderService ticket = (TicketOrderService)
> client.create();
> >> >
> >> >         String ticketOrder = ticket.getTicket("1", "2", new Date(),
> "3");
> >> >
> >> > On Thu, Sep 18, 2008 at 9:26 PM, Benson Margulies
> > <bimargulies@gmail.com>wrote:
> >> >> So, now the question is: what is the client you are using that
> >> >> constructed this message?
> >> >>
> >> >> On Thu, Sep 18, 2008 at 11:53 AM, Alexey Zavizionov
> >> >>
> >> >> <alexey.zavizionov@gmail.com> wrote:
> >> >> > I have added logging interceptors for client:
> >> >> > ==========================================
> >> >> >        client.getInInterceptors().add(new LoggingInInterceptor());
> >> >> >        client.getOutInterceptors().add(new
> LoggingOutInterceptor());
> >> >> > ==========================================
> >> >> >
> >> >> > Result:
> >> >> > ==========================================
> >> >> > Sep 18, 2008 5:50:11 PM
> >> >> > org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback
> >> >> > onClose INFO: Outbound Message
> >> >> > ---------------------------
> >> >> > Encoding: UTF-8
> >> >> > Headers: {SOAPAction=["urn:GetTicket"]}
> >> >> > Messages:
> >> >> > Payload: <soap:Envelope xmlns:soap="
> >> >> > http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Header><ns2:departing
> >> >> > xmlns:ns2="http://exoplatform.org/soap/xfire
> >> >>
> >> >> ">1</ns2:departing><ns2:arriving
> >> >>
> >> >> > xmlns:ns2="http://exoplatform.org/soap/xfire
> >> >>
> >> >> ">2</ns2:arriving><ns2:departureDate
> >> >>
> >> >> > xmlns:ns2="http://exoplatform.org/soap/xfire
> >> >>
> >> >> ">2008-09-18T17:50:11.346+02:00</ns2:departureDate><ns2:passenger
> >> >>
> >> >> > xmlns:ns2="http://exoplatform.org/soap/xfire
> >> >>
> >> >> ">3</ns2:passenger></soap:Header><soap:Body><ns2:getTicket
> >> >>
> >> >> > xmlns:ns2="http://exoplatform.org/soap/xfire
> >> >>
> >> >> "/></soap:Body></soap:Envelope>
> >> >>
> >> >> > --------------------------------------
> >> >> > Sep 18, 2008 5:50:11 PM org.apache.cxf.phase.PhaseInterceptorChain
> >> >> > doIntercept
> >> >> > ...
> >> >> > here same stack trace...
> >> >> > ...
> >> >> > Sep 18, 2008 5:50:12 PM
> >> >> > org.apache.cxf.interceptor.LoggingInInterceptor logging
> >> >> > INFO: Inbound Message
> >> >> > ----------------------------
> >> >> > Encoding: UTF-8
> >> >> > Headers:
> >> >> > Messages:
> >> >> > Message:
> >> >> >
> >> >> > Payload: <soap:Envelope xmlns:soap="
> >> >> > http://schemas.xmlsoap.org/soap/envelope/
> >> >>
> >> >>
> "><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>
> >> >></faultstring></soap:Fault></soap:Body></soap:Envelope>
> >> >>
> >> >> > --------------------------------------
> >> >> > ==========================================
> >> >> >
> >> >> > Regards,
> >> >> > Alexey.
> >> >> >
> >> >> > On Thu, Sep 18, 2008 at 6:16 PM, Benson Margulies <
> >> >>
> >> >> bimargulies@gmail.com>wrote:
> >> >> >> You are going to have to turn on logging. The problem here
is that
> >> >> >> the code is expecting the XML to contain a date in some format
> which
> >> >> >> it is not in. It looks to me as if it expects just an integer,
and
> is
> >> >> >> finding 'something else'. google 'cxf logging' and find the
> >> >> >> information about how to add the logging interceptors to your
> >> >> >> service.
> >> >> >>
> >> >> >> On Thu, Sep 18, 2008 at 11:05 AM, Alexey Zavizionov
> >> >> >>
> >> >> >> <alexey.zavizionov@gmail.com> wrote:
> >> >> >> > Hello list,
> >> >> >> >
> >> >> >> > I have an exception when getting method with Date parameter:
> >> >> >> >        Date date = Calendar.getInstance().getTime();
> >> >> >> >        String ticketOrder = ticket.getTicket("1", "2",
date,
> "3");
> >> >> >> >
> >> >> >> > ====================================================
> >> >> >> > Sep 18, 2008 4:44:21 PM
> org.apache.cxf.phase.PhaseInterceptorChain
> >> >> >> > doIntercept
> >> >> >> > INFO: Interceptor has thrown exception, unwinding now
> >> >> >> > org.apache.cxf.interceptor.Fault:
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.databinding.ElementDataReader.read(ElementDataReade
> >> >>r.java:66)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.databinding.ElementDataReader.read(ElementDataReade
> >> >>r.java:39)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor.handleMess
> >> >>age(SoapHeaderInterceptor.java:101)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >> >>hain.java:220)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.transport.MultipleEndpointObserver.onMessage(MultipleEndp
> >> >>ointObserver.java:86)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:13
> >> >>2)
> >> >>
> >> >> >> >        at java.lang.Thread.run(Thread.java:595)
> >> >> >> > Caused by: java.lang.IllegalArgumentException:
> >> >> >> >        at
> >> >>
> >> >>
> com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
> >> >>l$Parser.parseBigInteger(XMLGregorianCalendarImpl.java:2854)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
> >> >>l$Parser.parse(XMLGregorianCalendarImpl.java:2747)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
> >> >>l.<init>(XMLGregorianCalendarImpl.java:440)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl.new
> >> >>XMLGregorianCalendar(DatatypeFactoryImpl.java:224)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.util.date.XsDateTimeFormat.parseObject(XsDateTimeFo
> >> >>rmat.java:80)
> >> >>
> >> >> >> >        at java.text.Format.parseObject(Format.java:219)
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.type.basic.DateTimeType.readObject(DateTimeType.jav
> >> >>a:54)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.AegisXMLStreamDataReader.read(AegisXMLStreamDataRea
> >> >>der.java:82)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.AegisElementDataReader.read(AegisElementDataReader.
> >> >>java:50)
> >> >>
> >> >> >> >        at
> >> >>
> >> >>
> org.apache.cxf.aegis.databinding.ElementDataReader.read(ElementDataReade
> >> >>r.java:64)
> >> >>
> >> >> >> >        ... 6 more
> >> >> >> > ====================================================
> >> >> >> >
> >> >> >> > Service's simple interface has the method code:
> >> >> >> > ====================================================
> >> >> >> >  @WebMethod(operationName = "getTicket", action =
> "urn:GetTicket")
> >> >> >> >  @WebResult(name = "Ticket")
> >> >> >> >  public String getTicket(@WebParam(name = "departing",
header =
> >> >> >> > true) String departing,
> >> >> >> >      @WebParam(name = "arriving", header = true) String
> arriving,
> >> >> >> >      @WebParam(name = "departureDate", header = true)
Date
> >> >>
> >> >> departureDate,
> >> >>
> >> >> >> >      @WebParam(name = "passenger", header = true) String
> passenger)
> >> >> >> > ; ====================================================
> >> >> >> >
> >> >> >> > Regards,
> >> >> >> > Alexey.
> >
> >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> >
>

Mime
View raw message