LastModifiedToDateFormatter: Unable to parse date

1978
4
Jump to solution
12-04-2020 07:34 AM
MatejVrtich
Esri Contributor

Hi,

I've configured a custom connector to poll an external website for a text using the default HTTP Transport and Text Adapter.

csv-poll-in.png

 

However, the configured connector does not receive any data and this can be found in a log:

com.esri.ges.transport.http.LastModifiedToDateFormatter

Unable to parse date: Fri, 04 Dec 2020 15:17:37 GMT. java.text.ParseException: Unparseable date: "Fri, 04 Dec 2020 15:17:37 GMT" at java.text.DateFormat.parse(DateFormat.java:366) ~[?:?] at com.esri.ges.transport.http.LastModifiedToDateFormatter.toDate(LastModifiedToDateFormatter.java:26) [91:com.esri.ges.framework.transport.http-transport:10.8.1] at com.esri.ges.transport.http.HttpInboundTransport.onReceive(HttpInboundTransport.java:546) [91:com.esri.ges.framework.transport.http-transport:10.8.1] at com.esri.ges.transport.http.HttpInboundTransport.getData(HttpInboundTransport.java:245) [91:com.esri.ges.framework.transport.http-transport:10.8.1] at com.esri.ges.transport.http.HttpInboundTransport$WorkerThread.run(HttpInboundTransport.java:130) [91:com.esri.ges.framework.transport.http-transport:10.8.1]

The external website holding the data is setting the "Last-Modified" response header. It seems the HTTP Transport is having some issues parsing the date, even if the Receive New Data Only property is set to No in the configured connector.

Thanks for any insight.

Matej

0 Kudos
1 Solution

Accepted Solutions
DanWade
Esri Contributor

Hello @MatejVrtich ,

The reason there was no data ingested from the beginning was the data feed did not contain an Event Separator such as "\n" (line feed).

However, the logger, com.esri.ges.transport.http.LastModifiedToDateFormatter, was generating a valid error from a behavior found with the "Receive New Data Only" and a non-English OS. Apologies for the issue and this behavior has been logged as the following bug:

[BUG-000136861: HTTP Inbound Transport fails to parse date when using "Receive New Data Only" option on non-English OS.]

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable

It looks like the issue may be with the date format. Many input connectors have an advanced option called "Expected Date Format", where you can specify the type of date format for the connector to ingest. I'm not sure if your custom connector has this option, but it may be worth investigating anyway.

This GeoNet post goes into what appears to be the same issue at much more detail:

 
-Calvin
0 Kudos
MatejVrtich
Esri Contributor

Hi and thank you for your answer.

Configuring the "Expected Data Format" has no impact on this.

The date, which I refer to, is part of the "Last-Modified" HTTP header and not the data itself.

It seems the issue is on the HTTP transport level of the connector and not the adapter, which is parsing the data.

Thanks,

Matej

0 Kudos
Stefan_Jung
Esri Contributor

Hi @MatejVrtich,

the LastModifieldToDateFormatter is using the following date format: "EEE, dd MMM yyyy HH:mm:ss zzz"

I've just tested to parse the given date "Fri, 04 Dec 2020 15:17:37 GMT" with the SimpleDateFormat and got the same error message.

It looks like this is a localization issue. Thats why it will fail to parse the day and month in the date string.

If you change the system locals of your geoevent server machine to english it should work.

@EricIronside

So if not already done the LastModifiedToDateFormatter should use the Locals:

new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);

Best,

Stefan

 

Tags (1)
DanWade
Esri Contributor

Hello @MatejVrtich ,

The reason there was no data ingested from the beginning was the data feed did not contain an Event Separator such as "\n" (line feed).

However, the logger, com.esri.ges.transport.http.LastModifiedToDateFormatter, was generating a valid error from a behavior found with the "Receive New Data Only" and a non-English OS. Apologies for the issue and this behavior has been logged as the following bug:

[BUG-000136861: HTTP Inbound Transport fails to parse date when using "Receive New Data Only" option on non-English OS.]

0 Kudos