Mycat 1.6.Release [err:java.sql.SQLNonTransientException: find no Route:]

 
 
2017-09-15 07:06:13,299 [WARN ][$_NIOREACTOR-3-RW] ServerConnection [id=1, schema=TESTDB, host=127.0.0.1, user=root,txIsolation=3, autocommit=true, schema=TESTDB]SELECT * FROM `test`.`city` LIMIT 0 err:java.sql.SQLNonTransientException:  find no Route:SELECT * FROM `test`.`city` LIMIT 0 java.sql.SQLNonTransientException:  find no Route:SELECT * FROM `test`.`city` LIMIT 0
	at io.mycat.route.parser.druid.impl.DruidSelectParser.tryRoute(DruidSelectParser.java:439)
	at io.mycat.route.parser.druid.impl.DruidSelectParser.changeSql(DruidSelectParser.java:287)
	at io.mycat.route.parser.druid.impl.DefaultDruidParser.parser(DefaultDruidParser.java:67)
	at io.mycat.route.impl.DruidMycatRouteStrategy.routeNormalSqlWithAST(DruidMycatRouteStrategy.java:84)
	at io.mycat.route.impl.AbstractRouteStrategy.route(AbstractRouteStrategy.java:81)
	at io.mycat.route.RouteService.route(RouteService.java:133)
	at io.mycat.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:276)
	at io.mycat.server.ServerConnection.execute(ServerConnection.java:222)
	at io.mycat.server.handler.SelectHandler.handle(SelectHandler.java:105)
	at io.mycat.server.ServerQueryHandler.query(ServerQueryHandler.java:79)
	at io.mycat.net.FrontendConnection.query(FrontendConnection.java:317)
	at io.mycat.net.FrontendConnection.query(FrontendConnection.java:337)
	at io.mycat.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at io.mycat.net.FrontendConnection.rawHandle(FrontendConnection.java:478)
	at io.mycat.net.FrontendConnection.handle(FrontendConnection.java:460)
	at io.mycat.net.AbstractConnection.onReadData(AbstractConnection.java:321)
	at io.mycat.net.NIOSocketWR.asynRead(NIOSocketWR.java:190)
	at io.mycat.net.AbstractConnection.asynRead(AbstractConnection.java:273)
	at io.mycat.net.NIOReactor$RW.run(NIOReactor.java:102)
	at java.lang.Thread.run(Unknown Source)

根据错误信息画出类图Mycat 1.6.Release [err:java.sql.SQLNonTransientException: find no Route:]_第1张图片

 

解决方法

 

				if(key != null) {
					/* 换个位置
					int pos = key.indexOf(".");
					if(pos> 0) {
						key = key.substring(pos + 1);
					}
					*/
					if(key.equalsIgnoreCase(value)) {
						int pos = key.indexOf(".");
						if(pos> 0) {
							key = key.substring(pos + 1);
						}
						ctx.addTable(key.toUpperCase());
					}
					tableAliasMap.put(key.toUpperCase(), value);
				}if(key != null) {
					/* 换个位置
					int pos = key.indexOf(".");
					if(pos> 0) {
						key = key.substring(pos + 1);
					}
					*/
					if(key.equalsIgnoreCase(value)) {
						int pos = key.indexOf(".");
						if(pos> 0) {
							key = key.substring(pos + 1);
						}
						ctx.addTable(key.toUpperCase());
					}
					tableAliasMap.put(key.toUpperCase(), value);
				}


出现另一问题,(这是系统表记录查询相关信息,如果有用到,不一定适合这种修改方法,可以升级到mycat1.6.5)

 

 

2017-09-15 07:14:23,306 [WARN ][$_NIOREACTOR-3-RW] ServerConnection [id=1, schema=TESTDB, host=127.0.0.1, user=root,txIsolation=3, autocommit=true, schema=TESTDB]SELECT QUERY_ID, SUM(DURATION) AS SUM_DURATION FROM INFORMATION_SCHEMA.PROFILING GROUP BY QUERY_ID err:java.sql.SQLNonTransientException: can't find table define in schema PROFILING schema:TESTDB java.sql.SQLNonTransientException: can't find table define in schema PROFILING schema:TESTDB
	at io.mycat.route.util.RouterUtil.tryRouteForOneTable(RouterUtil.java:1052)
	at io.mycat.route.util.RouterUtil.tryRouteForTables(RouterUtil.java:947)
	at io.mycat.route.parser.druid.impl.DruidSelectParser.tryRoute(DruidSelectParser.java:412)
	at io.mycat.route.parser.druid.impl.DruidSelectParser.changeSql(DruidSelectParser.java:287)
	at io.mycat.route.parser.druid.impl.DefaultDruidParser.parser(DefaultDruidParser.java:67)
	at io.mycat.route.impl.DruidMycatRouteStrategy.routeNormalSqlWithAST(DruidMycatRouteStrategy.java:84)
	at io.mycat.route.impl.AbstractRouteStrategy.route(AbstractRouteStrategy.java:81)
	at io.mycat.route.RouteService.route(RouteService.java:133)
	at io.mycat.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:276)
	at io.mycat.server.ServerConnection.execute(ServerConnection.java:222)
	at io.mycat.server.handler.SelectHandler.handle(SelectHandler.java:105)
	at io.mycat.server.ServerQueryHandler.query(ServerQueryHandler.java:79)
	at io.mycat.net.FrontendConnection.query(FrontendConnection.java:317)
	at io.mycat.net.FrontendConnection.query(FrontendConnection.java:337)
	at io.mycat.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at io.mycat.net.FrontendConnection.rawHandle(FrontendConnection.java:478)
	at io.mycat.net.FrontendConnection.handle(FrontendConnection.java:460)
	at io.mycat.net.AbstractConnection.onReadData(AbstractConnection.java:321)
	at io.mycat.net.NIOSocketWR.asynRead(NIOSocketWR.java:190)
	at io.mycat.net.AbstractConnection.asynRead(AbstractConnection.java:273)
	at io.mycat.net.NIOReactor$RW.run(NIOReactor.java:102)
	at java.lang.Thread.run(Unknown Source)
 (io.mycat.server.ServerConnection:ServerConnection.java:281)


解决方法,再schema.xml中配置此表。

 

 

 

--------- 2018-10-23 在mycat 1.6.5 中发下如下代码 ----------

Mycat 1.6.Release [err:java.sql.SQLNonTransientException: find no Route:]_第2张图片

 

 

 

你可能感兴趣的:(JAVA,MyCat,MySql)