未显示用户的API使用情况

时间:2014-01-21 10:59:06

标签: wso2

我尝试使用文档说明将wso2 api manager(1.6.0)与wso2 bam(2.4.0)连接起来。我在Api Manager Publisher中看到了统计信息,但我无法看到"用户的API使用情况"。在Api Manager的日志文件中,我有以下异常。有人知道吗?

由于 斯特凡诺

[2014-01-21 11:52:14,551] ERROR - 为ProviderAPIUsage调用APIUsageStatisticsClient时出现APIProviderHostObject错误 org.wso2.carbon.apimgt.usage.client.exception.APIMgtUsageQueryServiceClientException:从JDBC数据库查询时发生错误         at org.wso2.carbon.apimgt.usage.client.APIUsageStatisticsClient.queryBetweenTwoDaysForAPIUsageByUser(APIUsageStatisticsClient.java:1211)         在org.wso2.carbon.apimgt.usage.client.APIUsageStatisticsClient.getAPIUsageByUser(APIUsageStatisticsClient.java:313)         at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_getAPIUsageByUser(APIProviderHostObject.java:2146)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         在java.lang.reflect.Method.invoke(Method.java:597)         在org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)         在org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)         在org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)         at org.jaggeryjs.rhino.publisher.modules.statistics.c1._c_getAPIUsageByUser_6(/publisher/modules/statistics/usage.jag:147)         在org.jaggeryjs.rhino.publisher.modules.statistics.c1.call(/publisher/modules/statistics/usage.jag)         在org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)         在org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)         在org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)         在org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)         at org.jaggeryjs.rhino.publisher.modules.statistics.c0._c_anonymous_11(/publisher/modules/statistics/module.jag:25)         在org.jaggeryjs.rhino.publisher.modules.statistics.c0.call(/publisher/modules/statistics/module.jag)         在org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0._c_anonymous_1(/publisher/site/blocks/stats/ajax/stats.jag:153)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0.call(/publisher/site/blocks/stats/ajax/stats.jag)         在org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0._c_script_0(/publisher/site/blocks/stats/ajax/stats.jag:4)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0.call(/publisher/site/blocks/stats/ajax/stats.jag)         在org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)         在org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0.call(/publisher/site/blocks/stats/ajax/stats.jag)         在org.jaggeryjs.rhino.publisher.site.blocks.stats.ajax.c0.exec(/publisher/site/blocks/stats/ajax/stats.jag)         at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570)         在org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)         在org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)         在org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)         在javax.servlet.http.HttpServlet.service(HttpServlet.java:755)         在javax.servlet.http.HttpServlet.service(HttpServlet.java:848)         在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)         在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)         在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)         在org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)         在org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)         在org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)         在org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)         在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)         在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)         在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)         在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)         在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)         在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)         at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)         at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve $ 1.invoke(CarbonTomcatValve.java:47)         在org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)         at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)         在org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)         at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)         在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)         at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)         在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)         在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)         在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)         at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:589)         在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.run(NioEndpoint.java:1653)         at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)         at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)         在java.lang.Thread.run(Thread.java:662) 引起:org.h2.jdbc.JdbcSQLException:Column" CONTEXT"必须在GROUP BY列表中; SQL语句: SELECT API,API_VERSION,VERSION,USERID,SUM(TOTAL_REQUEST_COUNT)AS TOTAL_REQUEST_COUNT,来自API_REQUEST_SUMMARY的上下文时间间隔时间' 2014-01-20' AND' 2014-01-22' GROUP BY API,API_VERSION,USERID ORDER BY TOTAL_REQUEST_COUNT DESC LIMIT 10 [90016-140]         at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)         at org.h2.message.DbException.get(DbException.java:167)         在org.h2.message.DbException.get(DbException.java:144)         在org.h2.expression.ExpressionColumn.updateAggregate(ExpressionColumn.java:148)         在org.h2.command.dml.Select.queryGroup(Select.java:335)         在org.h2.command.dml.Select.queryWithoutCache(Select.java:574)         在org.h2.command.dml.Query.query(Query.java:241)         在org.h2.command.CommandContainer.query(CommandContainer.java:80)         在org.h2.command.Command.executeQuery(Command.java:132)         at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:76)         at org.wso2.carbon.apimgt.usage.client.APIUsageStatisticsClient.queryBetweenTwoDaysForAPIUsageByUser(APIUsageStatisticsClient.java:1193)         ... 63更多

1 个答案:

答案 0 :(得分:0)

您能否验证您的数据库是否包含WSO @ AM和WSO2 BAM的正确表和索引?该错误指向不正确的查询。如果数据库是正确的,那么看起来构造的查询是错误的,您应该要求WSO2创建和发布/ bug。

Column "CONTEXT" must be in the GROUP BY list;
SQL statement: 
SELECT API, API_VERSION, VERSION, USERID, SUM(TOTAL_REQUEST_COUNT) AS TOTAL_REQUEST_COUNT, CONTEXT 
FROM API_REQUEST_SUMMARY 
WHERE time BETWEEN '2014-01-20' AND '2014-01-22' 
GROUP BY API, API_VERSION, USERID 
ORDER BY TOTAL_REQUEST_COUNT DESC LIMIT 10 [90016-140]