FIWARE / mintaka

implementation of the NGSI-LD temporal retrieval api.
5 stars 2 forks source link

class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap' #82

Closed pauloo23 closed 2 years ago

pauloo23 commented 2 years ago

I am trying to making this HTTP Get request: curl -G -X GET 'http://localhost:8080/temporal/entities/' \ -H 'NGSILD-Tenant: openiot' \ -H 'Link: <https://schema.lab.fiware.org/ld/context>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \ -d 'type=AirQualityObserved' \ -d 'attrs=CO' \ -d 'timeproperty=modifiedAt' \ -d 'timerel=before' \ -d 'timeAt=2022-03-15T11:00:00' \ This is my response: { "type": "https://uri.etsi.org/ngsi-ld/errors/InternalError", "title": "Unexpected error.", "status": 500, "detail": "class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')" } Versions: --> Orion-LD: latest --> Mintaka: Lastest --> TimescaleDB: timescale/timescaledb-postgis:latest-pg13 --> MongoDB: 4.4 Can please someone help me? Thanks

wistefan commented 2 years ago

Hi @pauloo23 , would be happy to help. Can you send me information on how the AirQualityObserved object looks like?

pauloo23 commented 2 years ago

Hi @pauloo23 , would be happy to help. Can you send me information on how the AirQualityObserved object looks like?

{ "id": "urn:ngsi-ld:AirQualityObserved:Porto-AmbientObserved-28079004-2016-03-18T17:00:00", "type": "AirQualityObserved", "CO": { "type": "Property", "value": 500, "unitCode": "GP" }, "CO_Level": { "type": "Property", "value": "moderate" }, "NO": { "type": "Property", "value": 45, "unitCode": "GQ" }, "NO2": { "type": "Property", "value": 69, "unitCode": "GQ" }, "NOx": { "type": "Property", "value": 139, "unitCode": "GQ" }, "SO2": { "type": "Property", "value": 11, "unitCode": "GQ" }, "address": { "type": "Property", "value": { "addressCountry": "ES", "addressLocality": "Madrid", "streetAddress": "Plaza de Espa\u00f1a", "type": "PostalAddress" } }, "airQualityIndex": { "type": "Property", "value": 65 }, "airQualityLevel": { "type": "Property", "value": "moderate" }, "areaServed": { "type": "Property", "value": "Brooklands" }, "dateObserved": { "type": "Property", "value": "2016-03-15T11:00:00/2016-03-15T12:00:00" }, "location": { "type": "GeoProperty", "value": { "type": "Point", "coordinates": [ -3.712247222222222, 40.423852777777775 ] } }, "precipitation": { "type": "Property", "value": 0 }, "refPointOfInterest": { "type": "Relationship", "object": "urn:ngsi-ld:PointOfInterest:28079004-Pza.deEspanya" }, "relativeHumidity": { "type": "Property", "value": 0.54 }, "reliability": { "type": "Property", "value": 0.7 }, "source": { "type": "Property", "value": "http://datos.madrid.es" }, "temperature": { "type": "Property", "value": 12.2 }, "typeOfLocation": { "type": "Property", "value": "outdoor" }, "windDirection": { "type": "Property", "value": 186 }, "windSpeed": { "type": "Property", "value": 0.64 }, "@context": [ "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld", "https://raw.githubusercontent.com/smart-data-models/dataModel.Environment/master/context.jsonld" ] }

wistefan commented 2 years ago

Hi @pauloo23,

it is due to a bug in the handling of list-contexts. Will be fixed as soon as #83 is merged. 2 things to notice: