我正在向FIWARE CEP发送REST POST请求,并期望输出甚至在文件中。但文件里什么都没有。
REST POST (Producer) -> CEP -> File Consumer
http://194.28.122.118:8080/ProtonOnWebServer/rest/events
{"Name":"TrafficReport", "volume":"9000"}
Catalina.out
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: started event message body reader
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: name value: TrafficReport looking for: Name
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: finished event message body reader
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
INFO: starting submitNewEvent
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.router.EventRouter routeTimedObject
INFO: routeTimedObject: forwarding event TrafficReport; Name=TrafficReport; Certainty=0.0; Cost=0.0; EventSource=; OccurrenceTime=null; Annotation=; Duration=0.0; volume=100000; EventId=f4aee2d0-2d4b-4c0c-a24f-ae452896fa75; ExpirationTime=null; Chronon=null; DetectionTime=1428072859603; to consumer...
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
INFO: events sent to proton runtime...发布于 2015-04-13 14:37:44
原因可能是您指定为使用者输出文件的路径不存在,或者tomcat无权写入此路径或写入您指定的文件。
查看日志文件(logs/catalina.out),查看是否出现如下警告:
WARNING: initializeAdapters: failed to initialize adapter Output adapter for consumer: DoSAttackTRConsumer, reason: No such file or directorycode here我还建议使用绝对路径而不是相对路径作为输出文件路径,因为在不同的操作系统中,Tomcat的“当前”目录可能是不同的。
您不需要创建文件,但您需要创建目录,并确保tomcat有权限写入此目录(或者如果文件存在,则写入此文件)
所以这里是我的建议:
确保您不会在catalina.out中看到上面列出的警告
https://stackoverflow.com/questions/29449106
复制相似问题