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

[fiware-stackoverflow] 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 https://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

      UPDATE 1 - catalina.log

      07-Jul-2016 07:52:39.914 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom started event message body reader
      07-Jul-2016 07:52:39.924 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom Event: ApeContextUpdate
      07-Jul-2016 07:52:39.924 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
      last attribute name: null last value: null
      07-Jul-2016 07:52:39.928 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader.readFrom finished event message body reader
      07-Jul-2016 07:52:39.929 INFO [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.resources.EventResource.submitNewEvent starting submitNewEvent
      07-Jul-2016 07:52:39.929 SEVERE [http-nio-8080-exec-1] com.ibm.hrl.proton.webapp.resources.EventResource.submitNewEvent Could not send event, reason: java.lang.NullPointerException, message: null

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:13|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:13|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 18:09|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 18:09|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 21:09|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 21:09|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

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

            Dates

            • Created:
              Updated:
              Resolved: