点击“元数据管理”菜单出错,提示“服务异常”
Robert 发布于73月前 8答/1993阅

我的原始需求是:


后台log:

04-03 18:04:02[ERROR]/grid/query/eova_object_code-eova_object

java.lang.RuntimeException: SQL条件不能不能包含where关键字:where id > 999

at com.eova.common.utils.db.SqlUtil.appendWhereCondition(SqlUtil.java:51)

at com.eova.widget.WidgetManager.buildQuerySQL(WidgetManager.java:108)

at com.eova.widget.grid.GridController.query(GridController.java:121)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.jfinal.aop.Invocation.invoke(Invocation.java:73)

at com.eova.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:49)

at com.jfinal.aop.Invocation.invoke(Invocation.java:67)

at com.eova.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:69)

at com.jfinal.aop.Invocation.invoke(Invocation.java:67)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83)

at com.eova.handler.UrlBanHandler.handle(UrlBanHandler.java:38)

at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:365)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)

at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

at java.lang.Thread.run(Thread.java:748)



实现过程中遇到的问题:


我觉得这个问题的原因是:




[沙发] sanshizi
@Robert sql文件夹中的初始化脚本不是最新的, 执行一下 "升级指南-必读.txt"
亮点
[地板] tidyko
@Robert 不要加where,已经说清楚啦。
[地毯] Robert
这个where不是我加的,我只是导入了项目,然后启动,登录以后,点击“元数据管理”菜单,就出错了,看到控制台的log信息,提示
04-03 18:04:02[ERROR]/grid/query/eova_object_code-eova_object
java.lang.RuntimeException: SQL条件不能不能包含where关键字:where id > 999
at com.eova.common.utils.db.SqlUtil.appendWhereCondition(SqlUtil.java:51)

在SqlUtil.java,里面有这个方法
/**
* 追加Where条件
* @param s sql 或 半sql
* @param condition SQL条件
* @return
*/
public static String appendWhereCondition(String s, String condition) {
if (xx.isEmpty(condition))
return s;

condition = condition.trim();
if (condition.toLowerCase().startsWith("where")) {
throw new RuntimeException("SQL条件不能不能包含where关键字:" + condition);
}

请问,为什么要报这个错,怎么解决呢?
谢谢
[4楼] huawei
@Robert 我也遇到了这个问题,谁能解答
[5楼] i阿宽
@Robert @huawei 1.6beta5版本的初始化SQL还不是最新的。需要执行一下 "升级指南-必读.txt"中的语句。
[6楼] Robert
这个问题解决了,是数据库的问题,把eova_object表里面的filter字段里面清空就可以了。谢谢大家
[7楼] 蔚蓝天空
@Robert 我也是这问题。谢谢楼主
[8楼] 码易1
赞,这样可以解决,虽然不懂怎么回事@Robert 
提交评论
嘿,我来帮你!