[Fiware-tech-help] CEP PROTON Null pointer exception

Jose Benítez jose at secmotic.com
Fri Jul 17 14:40:24 CEST 2015


My name is Jose Benitez, and I am working on a FIWARE project for the FINODEX accelerator (FINODEX012). 

I am trying to run an example which is essentialy the same as the DoSAttack that is provided with FI-LAB CEP instance. 

The differences are only three: The name of the parameter that arrives, which is now temperature instead of volume; The condition of the EPA, which now is only “TR3.temperature > TR2.temperature AND TR2.temperature > TR1.temperature”; And the temporal context, which is now an sliding window of 30 seconds long. 

So with that and following the documentation, I started the Proton, which returns me the following answer: 

Request: 
GET http://localhost:8081/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer <http://localhost:8081/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer> 
Response: 
{ 
 "state": "started”, 
  “definitions-url": "/ProtonOnWebServerAdmin/resources/definitions/Temperature” 
 } 
I
(Note that I made a tunnel to the 8081 port because my cep instance is in cloud and I am working in local). 
I have also restarted the Proton server via PUT queries.
Now I send the following request: 
Request: 
POST (application/json) http://localhost:8081/ProtonOnWebServer/rest/events <http://localhost:8081/ProtonOnWebServer/rest/events> 
{"Name":"TrafficReport", "temperature":"23"} 
Response 
Could not parse json event java.lang.NullPointerException, reason: null 

My Proton.properties located in /opt/tomcat10/webapps/ProtonOnWebServer/ is the following: 

metadataFileName=/opt/repositories/tomcat10/samples/Temperature.json 
metadataFilePathType=absolute 
outputPortNumber=3301 
inputPortNumber=3001 

And Temperature.json is: 

{"epn":{"events":[{"name":"TrafficReport","attributes":[{"name":"temperature","type":"Integer","dimension":0}]},{"name":"ExpectedCrash","attributes":[{"name":"Incendio","type":"Double","dimension":0}]}],"epas":[{"name":"IncreasingTraffic","epaType":"Sequence","context":"3MinAfterStartUp","inputEvents":[{"name":"TrafficReport","alias":"TR1","consumptionPolicy":"Consume","instanceSelectionPolicy":"First"},{"name":"TrafficReport","alias":"TR2","consumptionPolicy":"Consume","instanceSelectionPolicy":"First"},{"name":"TrafficReport","alias":"TR3","consumptionPolicy":"Consume","instanceSelectionPolicy":"First"}],"computedVariables":[],"assertion":"TR3.temperature>TR2.temperature AND TR2.temperature>TR1.temperature","evaluationPolicy":"Immediate","cardinalityPolicy":"Single","internalSegmentation":[],"derivedEvents":[{"name":"ExpectedCrash","reportParticipants":false,"expressions":{}}],"derivedActions":[]}],"contexts":{"temporal":[{"name":"3MinAfterStartUp","type":"SlidingTimeWindow","atStartup":true,"neverEnding":true,"duration":30,"slidingPeriod":0,"initiators":[],"terminators":[]}],"segmentation":[],"composite":[]},"consumers":[{"name":"SysTemCrashConsumer","type":"File","properties":[{"name":"filename","value":"./sample/Temperatura_IndendioPrevisto.txt"},{"name":"formatter","value":"json"},{"name":"delimiter","value":";"},{"name":"tagDataSeparator","value":"="},{"name":"SendingDelay","value":"1000"}],"events":[{"name":"ExpectedCrash"}],"actions":[]},{"name":"DoSAttackTRConsumer","type":"File","properties":[{"name":"filename","value":"./sample/Temperature_Alert.txt"},{"name":"formatter","value":"json"},{"name":"delimiter","value":";"},{"name":"tagDataSeparator","value":"="},{"name":"SendingDelay","value":"1000"}],"events":[{"name":"TrafficReport"}],"actions":[]}],"producers":[{"name":"TrafficReportFileProducer","type":"File","properties":[{"name":"filename","value":"./sample/PruebaTemperatura.txt"},{"name":"pollingInterval","value":"1000"},{"name":"sendingDelay","value":"5000"},{"name":"formatter","value":"json"},{"name":"delimiter","value":";"},{"name":"tagDataSeparator","value":"="}],"events":[]}],"actions":[],"name”:”Temperature”}} 


I can see in the tomcat's log the following:


Jul 17, 2015 2:39:28 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: name value: TrafficReport looking for: Name
Jul 17, 2015 2:39:28 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
SEVERE: Could not parse json event java.lang.NullPointerException, reason: null



Could you please help me find the error? 
Thanks in advance 
Jose Benítez
Cofounder Secmotic Innovation S.L.
http://www.secmotic.com <http://www.secmotic.com/>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20150717/97d00de9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Logo-firma.jpg
Type: image/jpeg
Size: 9660 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20150717/97d00de9/attachment.jpg>


More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy