cygnus订阅错误请求

yjghlzjz  于 2021-06-04  发布在  Flume
关注(0)|答案(0)|浏览(226)

我已经在orion中配置了在context broker中更新实体时对cygnus的订阅。默认情况下,orion代理有一个记录器接收器。这是subscribecontext:

$ (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
"entities": [
    {
        "type": "Room",
        "isPattern": "false",
        "id": "Room1"
    }
],
"attributes": [
    "pressure",
    "temperature"
],
"reference": "http://172.17.0.3:5050/notify",
"duration": "P1M",
"notifyConditions": [
    {
        "type": "ONCHANGE",
        "condValues": [
            "pressure"
        ]
    }
],
"throttling": "PT1S"
}
EOF

当我更新实体room1时,会向cygnus发送一个事件,但由于json无效语法,我有一个错误的请求:

org.apache.flume.source.http.HTTPBadRequestException: Request has invalid JSON Syntax.
    at org.apache.flume.source.http.JSONHandler.getEvents(JSONHandler.java:119)
    at org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:184)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
 Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
    at com.google.gson.Gson.fromJson(Gson.java:806)
    at com.google.gson.Gson.fromJson(Gson.java:761)
    at org.apache.flume.source.http.JSONHandler.getEvents(JSONHandler.java:117)
    ... 16 more
 Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2
    at com.google.gson.stream.JsonReader.expect(JsonReader.java:339)

你知道发生了什么吗??
提前谢谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题