Details
-
Type: extRequest
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:None
-
Sender Email:
-
HD-Chapter:Data
-
HD-Enabler:CEP
Description
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:
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>
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/>
_______________________________________________
Fiware-tech-help mailing list
Fiware-tech-help@lists.fi-ware.org
https://lists.fi-ware.org/listinfo/fiware-tech-help
[Created via e-mail received from: =?utf-8?Q?Jose_Ben=C3=ADtez?= <jose@secmotic.com>]
Activity
- All
- Comments
- History
- Activity
- Transitions
The issue has been emailed:
HELP-3608) [Fiware-tech-help] CEP PROTON Null pointer exception *Dear Jose,
The exception you are experiencing is due to trying to send events when the application is not loaded. Usually that happens when the definition file is not found/incorrect.
In order to overcome this, please do the following:
1) Correct the JSON file (a correct one is attached to this email)
The JSON editor was not able to parse the file. There is some problem with the commas in the last part: "name”:”Temperature”
2) if you are using REST for injecting events, then you don't need a file producer. I suggest removing it from definitions, since I think it also has an error in the definitions (the file path in the producer should be absolute, not relative)
3) POSTing again after steps 1 and 2
If this doesn't help, we would need your Tomcat logs files (specifically catalina.log or catalina.out) to see what is going on.
Thanks and good luck
Fabiana