camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel XMLRPC dateTime.iso8601 format.
Date Fri, 11 Mar 2016 16:07:40 GMT
Hi

Ah yeah that was a little bug in camel-xmlrpc. I have just fixed that
so it wont set those values to null.

Are in 2.16.3 and 2.17.0 releases.

On Fri, Mar 11, 2016 at 4:43 PM, Palmentieri Nunzio
<Nunzio.Palmentieri@eng.it> wrote:
> Hi Claus,
> maybe it could be a documentation problem. In fact, I found that setting the timeZone=it_IT
on the route, it works fine and it's capable to manage date.
>
> .to("xmlrpc:http://{{uri}}/?timeZone=it_IT&synchronous=true&basicEncoding=ISO-8859-1&basicUserName=xx&basicPassword=xx&encoding=ISO-8859-1&userAgent=xx")
>
>
> I think it should be at least specified on documentation that if timeZone is not set,
the component raise a NPE.
>
> Nunzio Palmentieri
>
> Engineering Ingegneria Informatica S.p.A.
> Via Emanuele Gianturco, 15 - 80142 Napoli
> Tel.    +39 0816103388
> Mob. +39 3351214806
> www.eng.it
>
> This electronic message contains information from Engineering Ingegneria Informatica
S.p.A., which may be privileged and confidential. The information is intended to be use of
the individual(s) or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this information is prohibited.
>
>
> -----Messaggio originale-----
> Da: Palmentieri Nunzio
> Inviato: venerdì 11 marzo 2016 11:56
> A: 'users@camel.apache.org'
> Oggetto: R: Camel XMLRPC dateTime.iso8601 format.
>
> Hi,
> the java code is:
>
> XmlRpcConfigImpl.java from "apache-xmlrpc-3.1.2"
>
> Nunzio Palmentieri
>
> Engineering Ingegneria Informatica S.p.A.
> Via Emanuele Gianturco, 15 - 80142 Napoli
> Tel.    +39 0816103388
> Mob. +39 3351214806
> www.eng.it
>
> This electronic message contains information from Engineering Ingegneria Informatica
S.p.A., which may be privileged and confidential. The information is intended to be use of
the individual(s) or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this information is prohibited.
>
>
> -----Messaggio originale-----
> Da: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Inviato: venerdì 11 marzo 2016 11:30
> A: users@camel.apache.org
> Oggetto: Re: Camel XMLRPC dateTime.iso8601 format.
>
> Ah
>
> What java code file is that exactly you did that change?
>
> On Fri, Mar 11, 2016 at 11:06 AM, Palmentieri Nunzio
> <Nunzio.Palmentieri@eng.it> wrote:
>> Hi,
>> I noticed that in the class XmlRpcConfigImpl.java from apache-xmlrpc-3.1.2, the timeZone
is correctly set to the default (Europe/Berlin) at row 33.
>>
>> But after, some Camel module calls setTimeZone with pTimeZone=null (row 86). I saw
it debugging.
>>
>> So, when the getTimeZone() (79) is called, it returns null.
>>
>> I changed the getTimeZone() as follows
>>
>> public TimeZone getTimeZone() {
>>         //return timeZone;
>>         if(timeZone != null)
>>                 return timeZone;
>>         return TimeZone.getDefault();
>> }
>>
>> and now it works.
>>
>>
>> Nunzio Palmentieri
>>
>> Engineering Ingegneria Informatica S.p.A.
>> Via Emanuele Gianturco, 15 - 80142 Napoli
>> Tel.    +39 0816103388
>> Mob. +39 3351214806
>> www.eng.it
>>
>> This electronic message contains information from Engineering Ingegneria Informatica
S.p.A., which may be privileged and confidential. The information is intended to be use of
the individual(s) or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this information is prohibited.
>>
>> -----Messaggio originale-----
>> Da: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> Inviato: mercoledì 9 marzo 2016 16:00
>> A: users@camel.apache.org
>> Oggetto: Re: Camel XMLRPC dateTime.iso8601 format.
>>
>> You get a NPE in Java itself. Wonder maybe you can upgrade Java? Or
>> try to google / search for that stacktrace error to see what you can
>> find.
>>
>> It seems like a timezone missing / not known or something. It can also
>> be related to what the locale is setup on that OS you use to run the
>> app.
>>
>>
>>
>> On Wed, Mar 9, 2016 at 2:31 PM, Palmentieri Nunzio
>> <Nunzio.Palmentieri@eng.it> wrote:
>>> Hi Gregoire,
>>> the Camel component is apache-camel-2.16.2
>>>
>>> The error is got when reading the following response from server:
>>> _____________________________________________________
>>> <?xml version="1.0"?>
>>> <methodResponse>
>>>  <params>
>>>   <param>
>>>    <value>
>>>     <struct>
>>>      <member>
>>>       <name>startDate</name>
>>>       <value>
>>>        <dateTime.iso8601>20160301T12:00:00+0000</dateTime.iso8601>
>>>       </value>
>>>      </member>
>>>      <member>
>>>       <name>responseCode</name>
>>>       <value>
>>>        <int>0</int>
>>>       </value>
>>>      </member>
>>>     </struct>
>>>    </value>
>>>   </param>
>>>  </params>
>>> </methodResponse>
>>> _____________________________________________________
>>>
>>> Following the stacktrace
>>>
>>> Stacktrace
>>> ---------------------------------------------------------------------------------------------------------------------------------------
>>> java.lang.NullPointerException
>>>         at java.util.Calendar$Builder.setTimeZone(Calendar.java:1313)
>>>         at sun.util.locale.provider.CalendarProviderImpl.getInstance(CalendarProviderImpl.java:86)
>>>         at java.util.Calendar.createCalendar(Calendar.java:1666)
>>>         at java.util.Calendar.getInstance(Calendar.java:1627)
>>>         at org.apache.xmlrpc.util.XmlRpcDateTimeFormat.parseObject(XmlRpcDateTimeFormat.java:138)
>>>         at org.apache.xmlrpc.util.XmlRpcDateTimeDateFormat.parseObject(XmlRpcDateTimeDateFormat.java:47)
>>>         at java.text.Format.parseObject(Format.java:243)
>>>         at org.apache.xmlrpc.parser.DateParser.setResult(DateParser.java:45)
>>>         at org.apache.xmlrpc.parser.AtomicParser.endElement(AtomicParser.java:59)
>>>         at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endElement(RecursiveTypeParserImpl.java:103)
>>>         at org.apache.xmlrpc.parser.MapParser.endElement(MapParser.java:193)
>>>         at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endElement(RecursiveTypeParserImpl.java:103)
>>>         at org.apache.xmlrpc.parser.XmlRpcResponseParser.endElement(XmlRpcResponseParser.java:208)
>>>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
>>>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1783)
>>>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970)
>>>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
>>>         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
>>>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
>>>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
>>>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
>>>         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
>>>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
>>>         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
>>>         at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
>>>         at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
>>>         at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
>>>         at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
>>>         at org.apache.xmlrpc.client.XmlRpcClientWorker$1.run(XmlRpcClientWorker.java:80)
>>>         at java.lang.Thread.run(Thread.java:745)
>>> ----------------------------------------------------------------------------
>>>
>>> Thanks in advance
>>>
>>> By
>>>
>>> Nunzio Palmentieri
>>>
>>> Engineering Ingegneria Informatica S.p.A.
>>> Via Emanuele Gianturco, 15 - 80142 Napoli
>>> Tel.    +39 0816103388
>>> Mob. +39 3351214806
>>> www.eng.it
>>>
>>> This electronic message contains information from Engineering Ingegneria Informatica
S.p.A., which may be privileged and confidential. The information is intended to be use of
the individual(s) or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this information is prohibited.
>>>
>>> -----Messaggio originale-----
>>> Da: Gregoire Autric [mailto:gautric@redhat.com]
>>> Inviato: mercoledì 9 marzo 2016 11:44
>>> A: users@camel.apache.org
>>> Oggetto: Re: Camel XMLRPC dateTime.iso8601 format.
>>>
>>> hi, Nunzio
>>>
>>> which camel component has been involved ? (
>>> http://camel.apache.org/xmlrpc.html ?)
>>> Could you copy/paste your error too ?
>>>
>>> by advance, thx
>>>
>>> Best Regards, Bien à vous,  どうぞお元気で,
>>> ____________________________________________________
>>> Greg AUTRIC
>>> - JBoss Middleware Consultant -
>>>
>>> On Tue, Mar 8, 2016 at 5:34 PM, Palmentieri Nunzio <
>>> Nunzio.Palmentieri@eng.it> wrote:
>>>
>>>> Hi,
>>>> I'm trying to use XMLRPC over apache Camel.
>>>>
>>>> I succeeded in getting response from xmlrpc server, but I got an error
>>>> When trying to receive a date field in the following format:
>>>>
>>>> <member>
>>>>       <name>startDate</name>
>>>>       <value>
>>>>             <dateTime.iso8601>20160301T12:00:00+0000</dateTime.iso8601>
>>>>       </value>
>>>> </member>
>>>>
>>>> Any suggestion?
>>>>
>>>> Thanks a lot
>>>>
>>>>
>>>> Nunzio Palmentieri
>>>>
>>>> Engineering Ingegneria Informatica S.p.A.
>>>> Via Emanuele Gianturco, 15 - 80142 Napoli
>>>> Tel.    +39 0816103388
>>>> Mob. +39 3351214806
>>>> www.eng.it
>>>>
>>>> This electronic message contains information from Engineering Ingegneria
>>>> Informatica S.p.A., which may be privileged and confidential. The
>>>> information is intended to be use of the individual(s) or entity named
>>>> above. If you are not the intended recipient, be aware that any disclosure,
>>>> copying, distribution or use of the contents of this information is
>>>> prohibited.
>>>>
>>>>
>>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message