NutzCN Logo
问答 请问在nutz sql 报错
发布于 2778天前 作者 qq_0e7a7a9d 1550 次浏览 复制 上一个帖子 下一个帖子
标签:

请问一下在linux 服务器上重启jetty之后查询sql会报错,
nutz 版本 1.6
报错日志如下:
org.nutz.dao.DaoException: !Nutz SQL Error: 'SELECT * FROM (SELECT ROW_NUMBER() OVER() AS ROWNUM, T.* FROM ( SELECT * FROM user_inf WHERE name='oddxsdfd' AND pf='wxd') T) AS A WHERE ROWNUM BETWEEN 1 AND 1 '
PreparedStatement:
'SELECT * FROM (SELECT ROW_NUMBER() OVER() AS ROWNUM, T.* FROM ( SELECT * FROM user_inf WHERE name=? AND pf=?) T) AS A WHERE ROWNUM BETWEEN 1 AND 1 '
CaseMessage=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() AS ROWNUM, T.* FROM ( SELECT * FROM user_inf WHERE name='oddxsdfd' at line 1
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:104)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:248)
at org.nutz.dao.impl.NutDao.fetch(NutDao.java:556)

```
这种错误每次多重启几次之后就正常又能查询。

8 回复

识别成oracle了,启动日志发一下

请留意一下,发帖按钮旁边还有一个按钮呢

好的,谢谢大大回复。这个问题我找了几天了,我现在去linux服务器上启动一下

this4j--> INFO {GameServer.java:60} - GameServer Started, free memory 435 Mb of 455 Mb
this4j--> INFO {HeartBeatTask.java:19} - ---HB,2----tTime:1
this4j--> INFO {Log.java:186} - Logging initialized @382ms
/mydata/login/qipai/login2/WEB-INF/classes/this4j--> INFO {Server.java:327} - jetty-9.2.14.v20151106
this4j--> INFO {NutFilter.java:81} - NutFilter[nutz] starting ...
this4j--> INFO {ErrorResourceLocation.java:28} - [loc=/mydata/login/qipai/login2/myapp/WEB-INF/classes]not exist
this4j--> INFO {NutLoading.java:55} - Nutz Version : 1.r.60 
this4j--> INFO {NutLoading.java:56} - Nutz.Mvc[nutz] is initializing ...
this4j--> INFO {AnnotationIocLoader.java:50} - Found 5 classes in 1 base-packages!
beans = ["payModule", "playModule", "orderModule", "commonModule", "userModule"]
this4j--> INFO {NutIoc.java:98} - NutIoc init begin ...
this4j--> INFO {NutIoc.java:115} - ... NutIoc init complete
this4j--> INFO {NutLoading.java:159} - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
this4j--> INFO {NutActionChainMaker.java:72} - Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
this4j--> INFO {NutActionChainMaker.java:72} - Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
this4j--> INFO {NutLoading.java:220} - Found 24 module methods
this4j--> INFO {NutLoading.java:274} - Setup application...
this4j--> INFO {LogUtil.java:55} - --------init-----
this4j--> INFO {DruidDataSource.java:715} - {dataSource-1} inited
this4j--> INFO {NutFilePool.java:23} - Init file-pool by: /mydata/.nutz/tmp/dao/ [200000]
this4j--> INFO {NutFilePool.java:66} - file-pool.cursor: 0
this4j--> INFO {Jdbcs.java:103} - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
11testthis4j--> INFO {Daos.java:127} - Can not find @Column(cdkType) in table/view (system_cdk)
this4j--> INFO {Daos.java:127} - Can not find @Column(getTime) in table/view (system_cdk)
this4j--> INFO {DruidDataSource.java:715} - {dataSource-2} inited
this4j--> INFO {Jdbcs.java:103} - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
this4j--> INFO {LogUtil.java:55} - 加载dao-->1
this4j--> INFO {Jdbcs.java:103} - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
this4j--> INFO {DruidDataSource.java:715} - {dataSource-3} inited

日志改成debug吧,不然看不出来

好吧,我下次遇到了再发出来,现在这会启动正常,谢谢大大的回复。

哦,不过我得告诉你怎么fix

在MainSetup.init方法内,获取dao之后,调用一下

dao.setExpert("mysql 5.5");

这样能强制设置为mysql模式,配置dao.js里面也可以

贴日志是为了看看数据库实例名,可能是里面有个oracle字样,导致匹配上了

在新的版本1.r.61 中发现已修复这个bug
fix: 腾讯云Mysql数据库被识别为DB2 issue_1210。

添加回复
请先登陆
回到顶部