telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
64 stars 105 forks source link

Unable to deliver event: String cannot be cast to JSONObject (sink ckan) #1507

Open AlvaroVega opened 6 years ago

AlvaroVega commented 6 years ago
time=2018-06-26T14:40:52.787Z | lvl=ERROR | corr=ed2212cc-794e-11e8-96d0-fa163e6b2dc7 | trans=4797d210-d032-4482-a655-b373c7115a7f | srv=sc_vlci | subsrv=/radiacion | op=run | comp=Cygnus | msg=org.apache.flume.SinkRunner$PollingRunner[160] : Unable to deliver event. Exception follows. java.lang.ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONObject at com.telefonica.iot.cygnus.backends.http.HttpBackend.createJsonResponse(HttpBackend.java:353) at com.telefonica.iot.cygnus.backends.http.HttpBackend.doRequest(HttpBackend.java:205) at com.telefonica.iot.cygnus.backends.http.HttpBackend.doRequest(HttpBackend.java:131) at com.telefonica.iot.cygnus.backends.ckan.CKANBackendImpl.doCKANRequest(CKANBackendImpl.java:566) at com.telefonica.iot.cygnus.backends.ckan.CKANBackendImpl.insert(CKANBackendImpl.java:178) at com.telefonica.iot.cygnus.backends.ckan.CKANBackendImpl.persist(CKANBackendImpl.java:90) at com.telefonica.iot.cygnus.sinks.NGSICKANSink.persistAggregation(NGSICKANSink.java:527) at com.telefonica.iot.cygnus.sinks.NGSICKANSink.persistBatch(NGSICKANSink.java:260) at com.telefonica.iot.cygnus.sinks.NGSISink.processNewBatches(NGSISink.java:558) at com.telefonica.iot.cygnus.sinks.NGSISink.process(NGSISink.java:370) at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68) at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147) at java.lang.Thread.run(Thread.java:748)
AlvaroVega commented 4 years ago

This error was found in cygnus 1.7.0 https://github.com/telefonicaid/fiware-cygnus/blob/release/1.7.0/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/http/HttpBackend.java#L353