使用Sharding-JDBC读写分离,SQL中有 count()函数报错?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

使用Sharding-JDBC读写分离,SQL中有 count()函数报错?报错

爱吃鱼的程序员 2020-06-08 14:17:47 145

使用Sharding-JDBC读写分离,SQL中有 count()函数报错

严重: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: com.alibaba.druid.sql.ast.expr.SQLAggregateExpr.getOption()Lcom/alibaba/druid/sql/ast/expr/SQLAggregateExpr$Option;] with root cause
java.lang.NoSuchMethodError: com.alibaba.druid.sql.ast.expr.SQLAggregateExpr.getOption()Lcom/alibaba/druid/sql/ast/expr/SQLAggregateExpr$Option;
	at com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.mysql.MySQLSelectVisitor.visit(MySQLSelectVisitor.java:110)
	at com.alibaba.druid.sql.ast.expr.SQLAggregateExpr.accept0(SQLAggregateExpr.java:98)
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
	at com.alibaba.druid.sql.visitor.SQLASTOutputVisitor.visit(SQLASTOutputVisitor.java:723)
	at com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.mysql.MySQLSelectVisitor.visit(MySQLSelectVisitor.java:92)
	at com.alibaba.druid.sql.ast.statement.SQLSelectItem.accept0(SQLSelectItem.java:86)
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
	at com.alibaba.druid.sql.visitor.SQLASTOutputVisitor.printSelectList(SQLASTOutputVisitor.java:270)
	at com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.mysql.MySQLSelectVisitor.printSelectList(MySQLSelectVisitor.java:56)
	at com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor.visit(MySqlOutputVisitor.java:223)
	at com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.mysql.MySQLSelectVisitor.visit(MySQLSelectVisitor.java:68)
	at com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.accept0(MySqlSelectQueryBlock.java:255)
	at com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.accept0(MySqlSelectQueryBlock.java:246)
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
	at com.alibaba.druid.sql.visitor.SQLASTOutputVisitor.visit(SQLASTOutputVisitor.java:671)
	at com.alibaba.druid.sql.ast.statement.SQLSelect.accept0(SQLSelect.java:84)
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
	at com.alibaba.druid.sql.visitor.SQLASTOutputVisitor.visit(SQLASTOutputVisitor.java:770)
	at com.alibaba.druid.sql.ast.statement.SQLSelectStatement.accept0(SQLSelectStatement.java:58)
	at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
	at com.dangdang.ddframe.rdb.sharding.parser.SQLParseEngine.parse(SQLParseEngine.java:66)
	at com.dangdang.ddframe.rdb.sharding.router.SQLRouteEngine.parseSQL(SQLRouteEngine.java:93)
	at com.dangdang.ddframe.rdb.sharding.router.PreparedSQLRouter.route(PreparedSQLRouter.java:55)
	at com.dangdang.ddframe.rdb.sharding.jdbc.ShardingPreparedStatement.rout

 

SQL druid
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-08 14:17:57

    请参考faq:http://dangdangdotcom.github.io/sharding-jdbc/01-start/faq/

    第二个问题

    0 0
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题