Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-6857

FIWARE.Question.Tech.Data.CEP.Orion / Proton subscription: java.lang.NullPointerException parsing an event from Orion

    Details

      Description

      Created question in FIWARE Q/A platform on 01-07-2016 at 12:07
      Please, ANSWER this question AT http://stackoverflow.com/questions/38142597/orion-proton-subscription-java-lang-nullpointerexception-parsing-an-event-fro

      Question:
      Orion / Proton subscription: java.lang.NullPointerException parsing an event from Orion

      Description:
      My Proton instance fails with a java.lang.NullPointerException whenever an event is sent by Orion

      this is the Proton log:

      proton_1 | 01-Jul-2016 09:46:03.117 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom started event message body reader
      proton_1 | 01-Jul-2016 09:46:03.125 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom Event: ApeContextUpdate
      proton_1 | 01-Jul-2016 09:46:03.126 SEVERE [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom Could not parse XML NGSI event java.lang.NullPointerException, reason: null
      proton_1 | last attribute name: null last value: null
      proton_1 | 01-Jul-2016 09:46:03.130 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom finished event message body reader
      proton_1 | 01-Jul-2016 09:46:03.131 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.resources.EventResource.submitNewEvent starting submitNewEvent
      proton_1 | 01-Jul-2016 09:46:03.132 SEVERE [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.resources.EventResource.submitNewEvent Could not send event, reason: java.lang.NullPointerException, message: null

      I've read the Appendix of the User guide and double checked the event name and the attributes list.

      This is an xml sent by orion:

      POST /ProtonOnWebServer/rest/events HTTP/1.1
      User-Agent: orion/0.28.0 libcurl/7.19.7
      Host: localhost:8080
      Accept: application/xml, application/json
      Content-length: 772
      Content-type: application/xml

      <notifyContextRequest>
      <subscriptionId>57762eb9982959644644f9ee</subscriptionId>
      <originator>localhost</originator>
      <contextResponseList>
      <contextElementResponse>
      <contextElement>
      <entityId type="Ape" isPattern="false">
      <id>u1</id>
      </entityId>
      <contextAttributeList>
      <contextAttribute>
      <name>carsharing</name>
      <type>urn:x-ogc:def:trs:IDAS:1.0:ISO8601</type>
      <contextValue>2016-07-01T11:01:06</contextValue>
      </contextAttribute>
      </contextAttributeList>
      </contextElement>
      <statusCode>
      <code>200</code>
      <reasonPhrase>OK</reasonPhrase>
      </statusCode>
      </contextElementResponse>
      </contextResponseList>
      </notifyContextRequest>

      This is the definition of the Proton project (BTW this is the project copied from
      the server filesystem because also the rest api fails with a
      NullPointerException)

      {
      "epn": {
      "events": [
      {
      "name": "ApeContextUpdate",
      "createdDate": "Fri Jul 01 2016",
      "attributes": [

      { "name": "entityId", "type": "String", "dimension": "0" }

      ,

      { "name": "entityType", "type": "String", "dimension": "0" }

      ,

      { "name": "carsharing", "type": "Date", "dimension": "0" }

      ]
      }
      ],
      "epas": [],
      "contexts":

      { "temporal": [], "segmentation": [], "composite": [] }

      ,
      "consumers": [],
      "producers": [],
      "name": "t0"
      }
      }

      and this is my docker-compose file:

      mongo:
      image: mongo:2.6
      command: --smallfiles --quiet

      proton:
      image: fiware/proactivetechnologyonline
      ports:

      • "8080:8080"

      orion:
      image: fiware/orion:0.28
      links:

      • mongo
      • proton
        command: -dbhost mongo --silent
        ports:
      • "1026:1026"

      I'm using Orion 0.28 (the last one that supports XML notifications) and the latest Proton

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3d 1h 28m 1 Uri Shani 04/Jul/16 4:35 PM
        In Progress In Progress Answered Answered
        14s 1 Uri Shani 04/Jul/16 4:35 PM
        Answered Answered Closed Closed
        1h 31m 1 Backlog Manager 04/Jul/16 6:06 PM

          People

          • Assignee:
            urishani Uri Shani
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: