[ 
https://issues.apache.org/jira/browse/OLINGO-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17511163#comment-17511163
 ] 

Kai Stritzelberger commented on OLINGO-1501:
--------------------------------------------

Hi, we were facing the same issue.

In our case this issue originated in our client code which calls Olingo 
functionality e.g. EntityProvider.readFeed method.

In our case no custom type mapping was provided to this function, therefore 
Olingo tried to convert e.g. the simple field type EdmDateTimeOffset into the 
default type java.util.Calendar. 

In our case we get EdmDateTimeOffset fields with nanosecond accuracy. And since 
java.util.Calendar can not handle nanoseconds, an Exception was thrown. 
(Checking out the Olingo code, this only applies to non-json format, since 
Olingo just ignores nanoseconds in json format)

We could resolve this issue by passing type mappings with 
EntityProviderReadProperties to our readFeed method and use java.sql.Timestamp 
for fields with the type EdmDateTimeOffset.

Hope this helps,

Kai

> EdmSimpleTypeException: The literal '2020-09-14T07:15:16.1447570' is not 
> formatted properly.
> --------------------------------------------------------------------------------------------
>
>                 Key: OLINGO-1501
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1501
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.11
>            Reporter: Abdul Malik
>            Priority: Blocker
>         Attachments: output.txt
>
>
> Getting a date format exception when trying for insert/read entity with xml 
> format.
> org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The literal 
> '2020-09-14T07:15:16.1447570' is not formatted properly.
>  
> Accept type : application/xml
>  
> PFA the output data in postman.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to