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

FIWARE.Question.Tech.Data.CEP.Proton-CEP Receiving events API NGSI/XML NullPointerException

    Details

      Description

      Created question in FIWARE Q/A platform on 12-11-2015 at 19:11
      Please, ANSWER this question AT http://stackoverflow.com/questions/33678805/proton-cep-receiving-events-api-ngsi-xml-nullpointerexception

      Question:
      Proton-CEP Receiving events API NGSI/XML NullPointerException

      Description:
      I have trouble sending NGSI/XML formatted events to my Proton-CEP GE. The use case is that I will need Orion to send events to CEP.

      Orion is configured to send events to Proton, which are correctly received. However, Proton reports NullPointerException when it receives them.

      The output from catalina.out is:

      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
      INFO: started event message body reader
      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
      INFO: Event: DeviceContextUpdate
      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
      SEVERE: Could not parse XML NGSI event java.lang.NullPointerException, reason: null
      last attribute name: null last value: null
      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
      INFO: finished event message body reader
      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
      INFO: starting submitNewEvent
      Nov 12, 2015 7:30:27 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
      SEVERE: Could not send event, reason: java.lang.NullPointerException, message: null

      Sending the following JSON event directly to CEP works:

      {"Name": "Device", "datacount5": "10", "lastupdate": "12/11/2015-17:09:08"}

      INFO: starting submitNewEvent
      Nov 12, 2015 7:31:39 PM com.ibm.hrl.proton.router.EventRouter routeTimedObject
      INFO: routeTimedObject: forwarding event Device; EventId=32314f63-75d3-489f-9d8d-dbd0ba4a42b8; Chronon=null; DetectionTime=1447353099831; Name=Device; Certainty=0.0; Cost=0.0; lastupdate=1447344548000; EventSource=; OccurrenceTime=null; datacount5=10; Annotation=; Duration=0.0; ExpirationTime=null; to consumer...
      Nov 12, 2015 7:31:39 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
      INFO: events sent to proton runtime...

      However, sending it in NGSI/XML produced a NullPointer Exception as above. The sent message is:

      <notifyContextRequest>
      <subscriptionId>51a60c7a286043f73ce9606c</subscriptionId>
      <originator>localhost</originator>
      <contextResponseList>
      <contextElementResponse>
      <contextElement>
      <entityId type="Device" isPattern="false">
      <id>Device.imei2</id>
      </entityId>
      <contextAttributeList>
      <contextAttribute>
      <name>datacount5</name>
      <contextValue>5</contextValue>
      </contextAttribute>
      </contextAttributeList>
      </contextElement>
      <statusCode>
      <code>200</code>
      <reasonPhrase>OK</reasonPhrase>
      </statusCode>
      </contextElementResponse>
      </contextResponseList>
      </notifyContextRequest>

      Note: I have also tried sending the message found in the documentation and I get the same NullPointerException, so I know it is not a XML formatting issue.

      What is the reason phqp the JSON objects are accepted, but the NGSI/XML fail?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-11-12 21:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2015-11-12 21:05|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            TALI Fabiana Fournier
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: