使用 POSTMAN 在 saiku 中命中查询 EXECUTE API 时出错

Error while hit the query EXECUTE API in saiku using POSTMAN

I have API for execute the query [http://localhost:8080/saiku/rest/saiku/api/query/execute] 并且我将输入作为 application/json.

正文:

{
    "name": "0A470887-83B3-BCCD-A01C-1AC522C394A6",
    "queryModel": {
        "axes": {
            "FILTER": {
                "mdx": null,
                "filters": [],
                "sortOrder": null,
                "sortEvaluationLiteral": null,
                "hierarchizeMode": null,
                "location": "FILTER",
                "hierarchies": [],
                "nonEmpty": false,
                "aggregators": []
            },
            "COLUMNS": {
                "mdx": null,
                "filters": [],
                "sortOrder": null,
                "sortEvaluationLiteral": null,
                "hierarchizeMode": null,
                "location": "COLUMNS",
                "hierarchies": [],
                "nonEmpty": true,
                "aggregators": []
            },
            "ROWS": {
                "mdx": null,
                "filters": [],
                "sortOrder": null,
                "sortEvaluationLiteral": null,
                "hierarchizeMode": null,
                "location": "ROWS",
                "hierarchies": [
                    {
                        "name": "[Date].[Time]",
                        "levels": {
                            "Year": {
                                "name": "Year"
                            }
                        },
                        "cmembers": {}
                    }
                ],
                "nonEmpty": true,
                "aggregators": []
            }
        },
        "visualTotals": false,
        "visualTotalsPattern": null,
        "lowestLevelsOnly": false,
        "details": {
            "axis": "COLUMNS",
            "location": "BOTTOM",
            "measures": [
                {
                    "name": "Average Magnitude",
                    "type": "EXACT"
                }
            ]
        },
        "calculatedMeasures": [],
        "calculatedMembers": []
    },
    "queryType": "OLAP",
    "type": "QUERYMODEL",
    "cube": {
        "uniqueName": "[earthquakes].[Global Earthquakes].[Global Earthquakes].[Earthquakes]",
        "name": "Earthquakes",
        "connection": "earthquakes",
        "catalog": "Global Earthquakes",
        "schema": "Global Earthquakes",
        "caption": null,
        "visible": false
    },
    "mdx": null,
    "parameters": {},
    "plugins": {},
    "properties": {
        "saiku.olap.query.automatic_execution": true,
        "saiku.olap.query.nonempty": true,
        "saiku.olap.query.nonempty.rows": true,
        "saiku.olap.query.nonempty.columns": true,
        "saiku.ui.render.mode": "table",
        "saiku.olap.query.filter": true,
        "saiku.olap.result.formatter": "flattened",
        "org.saiku.query.explain": true,
        "saiku.olap.query.drillthrough": true,
        "org.saiku.connection.scenario": false
    },
    "metadata": {}
}

一旦我点击 API 就意味着我得到了一个错误,例如

SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class org.saiku.web.rest.objects.resultset.QueryResult, and Java type class org.saiku.web.rest.objects.resultset.QueryResult, and MIME media type application/octet-stream was not found.

SEVERE: A message body writer for Java class org.saiku.olap.query2.ThinQuery, and Java type class org.saiku.olap.query2.ThinQuery, and MIME media type application/octet-stream was not found.
The registered message body writers compatible with the MIME media type are:
*/* ->
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
  com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
  com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
  com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
  com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
application/octet-stream ->
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider

但它在本地主机网络应用程序中工作正常,而不是在 POSTMAN

我的案例遇到了同样的问题,这已经解决了我的问题 1。http://localhost:8080/saiku/rest/saiku/username/query/queryname/, 2.http://localhost:8080/saiku/rest/saiku/api/query/execute/。 当您调用 post man 时,两个查询名称必须相同。对于 api 2 queryname 值在输入中 Json(参数作为名称).