AnsweredAssumed Answered

OData query operation: unknown DateTime error

Question asked by benoitdelvaux on Apr 26, 2016
Latest reply on Apr 29, 2016 by benoitdelvaux

Hello,

 

I try to execute a OData query operation against SAP SuccessFactors OData endpoint.

I get the following error :

Failed while storing output; Caused by:
org.joda.time.
DateTime cannot be cast to org.joda.time.LocalDateTime

 

 

 

com.boomi.connector.ConnectorException: Failed while storing output
  at com.boomi.connector.generic.DataTracker.addResult(DataTracker.java:303)
  at com.boomi.connector.generic.DataTracker.addPartialResult(DataTracker.java:198)
  at com.boomi.connector.generic.GenericResponse.addPartialResult(GenericResponse.java:52)
  at com.boomi.connector.api.ResponseUtil.addPartialSuccess(ResponseUtil.java:263)
  at com.boomi.connector.odata.entity.ODataQueryEntityOperation.executeQuery(ODataQueryEntityOperation.java:67)
  at com.boomi.connector.util.BaseQueryOperation.execute(BaseQueryOperation.java:35)
  at com.boomi.connector.generic.GenericConnectorAction.invoke(GenericConnectorAction.java:165)
  at com.boomi.connector.base.BaseConnectorAction.invokeBase(BaseConnectorAction.java:275)
  at com.boomi.connector.base.BaseConnectorAction.invoke(BaseConnectorAction.java:242)
  at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at com.boomi.util.ClassUtil$InvokerWithClassLoader.invoke(ClassUtil.java:360)
  at com.sun.proxy.$Proxy58.invoke(Unknown Source)
  at com.boomi.process.shape.ConnectorShapeHandler.execute(ConnectorShapeHandler.java:150)
  at com.boomi.process.shape.StartShape.execute(StartShape.java:132)
  at com.boomi.process.graph.ProcessShape.executeShape(ProcessShape.java:541)
  at com.boomi.process.graph.ProcessGraph.execute(ProcessGraph.java:295)
  at com.boomi.process.ProcessExecution.call(ProcessExecution.java:782)
  at com.boomi.execution.ExecutionTask.call(ExecutionTask.java:905)
  at com.boomi.execution.ExecutionTask.call(ExecutionTask.java:63)
  at com.boomi.util.concurrent.CancellableFutureTask.run(CancellableFutureTask.java:172)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: org.joda.time.DateTime cannot be cast to org.joda.time.LocalDateTime
  at com.boomi.connector.odata.util.ODataFormatConverter$DateTimeOffsetConverter.toXML(ODataFormatConverter.java:181)
  at com.boomi.connector.odata.util.ODataFormatConverter.toXMLValue(ODataFormatConverter.java:86)
  at com.boomi.connector.odata.entity.ODataEntityConnection$EntityPayload.writeSimpleProperty(ODataEntityConnection.java:381)
  at com.boomi.connector.odata.entity.ODataEntityConnection$EntityPayload.writeProperty(ODataEntityConnection.java:370)
  at com.boomi.connector.odata.entity.ODataEntityConnection$EntityPayload.writeEntity(ODataEntityConnection.java:346)
  at com.boomi.connector.odata.entity.ODataEntityConnection$EntityPayload.writeTo(ODataEntityConnection.java:314)
  at com.boomi.store.impl.WriteStoreImpl.storeData(WriteStoreImpl.java:493)
  at com.boomi.store.impl.WriteStoreImpl.storeImpl(WriteStoreImpl.java:303)
  at com.boomi.store.impl.WriteStoreImpl.store(WriteStoreImpl.java:239)
  at com.boomi.connector.generic.DataTracker.addResult(DataTracker.java:295)
  ... 24 more

PS: Find in attach the complete log of the process execution as retrieved from the Local Atom logs

 

I only have this error when DateTime data types are retrieved in the query (otherwise it works flawlessly):

 

 

Here is a sample XML object as exposed by the OData endpoint:

 

<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://api012.successfactors.eu:443/odata/v2/">

  <title type="text">Position</title>

  <id>https://api012.successfactors.eu:443/odata/v2/Position</id>

  <updated>2016-04-26T12:46:29Z</updated>

  <link rel="self" title="Position" href="Position"></link>

  <entry>

  <id>https://api012.successfactors.eu:443/odata/v2/Position(code='TEST_POS_SYNC',effectiveStartDate=datetime'1900-01-01T00:00:00')</id>

    <title type="text"></title>

    <updated>2016-04-26T12:46:29Z</updated>

    <author>

      <name></name>

    </author>

    <category term="SFOData.Position" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"></category>

    <content type="application/xml">

      <m:properties>

        <d:effectiveStartDate m:type="Edm.DateTime">1900-01-01T00:00:00</d:effectiveStartDate>

        <d:code>TEST_POS_SYNC</d:code>

        <d:positionControlled m:null="true"></d:positionControlled>

        <d:transactionSequence m:type="Edm.Int64">1</d:transactionSequence>

        <d:mdfSystemObjectType>Position</d:mdfSystemObjectType>

        <d:location>BE Liège</d:location>

        <d:effectiveStatus>A</d:effectiveStatus>

        <d:lastModifiedDateTime m:type="Edm.DateTimeOffset">2015-11-25T14:25:46Z</d:lastModifiedDateTime>

        <d:type m:null="true"></d:type>

        <d:effectiveEndDate m:type="Edm.DateTime">9999-12-31T00:00:00</d:effectiveEndDate>

        <d:vacant m:type="Edm.Boolean">false</d:vacant>

      </m:properties>

    </content>

  </entry>

</feed>

 

What I already try was to adjust the Date Format of the XML Profile Element:

Originally it was set to:     yyyy-MM-dd'T'HH:mm:ssZ

Which I updated to:           yyyy-MM-dd'T'HH:mm:ss'Z'

 

But I'm still getting the same error.

I already googled the error and searched amongst boomi forums but I could not find someone with a similar error message.

Any help would be more than welcome.

 

Cheers,

Ben

Outcomes