NutzCN Logo
问答 jdbc4.MySQLSyntaxErrorException: Table 'nutzbook.t_user' doesn't exist
发布于 232天前 作者 sunhao 213 次浏览 复制 上一个帖子 下一个帖子
标签:

有没有大侠知道这个错误是什么原因导致的? 我看User.java有@Table 哇...
00:20:33.371 DEBUG (NutIoc.java:209) get - >> Make...'dataSource_slave'<>
00:20:33.371 DEBUG (DefaultMirrorFactory.java:70) getMirror - Load class com.alibaba.druid.pool.DruidDataSource without AOP
00:20:33.372 DEBUG (ScopeContext.java:59) save - Save object 'dataSource_slave' to [app]
00:20:33.372 DEBUG (NutIoc.java:151) get - Get 'conf'<>
00:20:33.375 INFO (DruidDataSource.java:722) init - {dataSource-2} inited
00:20:33.375 DEBUG (NutIoc.java:151) get - Get 'jedisPool'<class redis.clients.jedis.JedisPool>
00:20:33.490 DEBUG (AbstractJdbcExpert.java:106) setupEntityField - Table 't_user_profile' doesn't exist!
00:20:33.531 DEBUG (AbstractJdbcExpert.java:106) setupEntityField - Table 't_permission_category' doesn't exist!
00:20:33.532 DEBUG (AbstractJdbcExpert.java:106) setupEntityField - Table 't_permission' doesn't exist!
00:20:33.533 DEBUG (AbstractJdbcExpert.java:106) setupEntityField - Table 't_role' doesn't exist!
00:20:33.535 DEBUG (AbstractJdbcExpert.java:106) setupEntityField - Table 't_User' doesn't exist!
00:20:33.545 DEBUG (NutDaoExecutor.java:388) printSQL - SELECT COUNT(*) FROM t_User
00:20:33.570 DEBUG (NutDaoExecutor.java:97) exec - SQLException
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'nutzbook.t_user' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_101]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_101]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.Util.getInstance(Util.java:387) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2547) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2505) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1370) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2363) ~[druid-1.0.24.jar:1.0.24]
at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481) ~[druid-1.0.24.jar:1.0.24]
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) ~[druid-1.0.24.jar:1.0.24]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) ~[druid-1.0.24.jar:1.0.24]
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:211) ~[druid-1.0.24.jar:1.0.24]
at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:138) ~[druid-1.0.24.jar:1.0.24]
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:246) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:165) ~[nutz-plugins-daocache-1.r.56.jar:?]
at net.wendal.nutzbook.util.MasterSlaveDaoExecutor.exec(MasterSlaveDaoExecutor.java:39) ~[classes/:?]
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:147) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:114) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:81) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:70) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:267) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:275) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.NutDao.func(NutDao.java:740) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.NutDao.func(NutDao.java:721) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.NutDao._count(NutDao.java:708) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.dao.impl.NutDao.count(NutDao.java:671) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at net.wendal.nutzbook.MainSetup.init(MainSetup.java:81) ~[classes/:?]
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.mvc.NutFilter._init(NutFilter.java:87) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.nutz.mvc.NutFilter.init(NutFilter.java:65) ~[nutz-1.r.58-20160902.080314-54.jar:?]
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4561) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204) ~[catalina.jar:8.5.4]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) ~[catalina.jar:8.5.4]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) ~[catalina.jar:8.5.4]
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1702) ~[catalina.jar:8.5.4]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.5.4]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_101]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_101]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482) ~[catalina.jar:8.5.4]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431) ~[catalina.jar:8.5.4]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.5.4]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_101]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_101]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) ~[?:1.8.0_101]
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[?:1.8.0_101]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[?:1.8.0_101]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) ~[?:1.8.0_101]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324) ~[?:1.8.0_101]
at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:1.8.0_101]
at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:1.8.0_101]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_101]
at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:1.8.0_101]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) ~[?:1.8.0_101]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) ~[?:1.8.0_101]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) ~[?:1.8.0_101]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_101]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
00:20:33.581 ERROR (NutLoading.java:124) load - Error happend during start serivce!
org.nutz.dao.DaoException: !Nutz SQL Error: 'SELECT COUNT(*) FROM t_User '

19 回复

大大的插入代码或日志按钮都不按.

Daos.createTableInPackage的参数与pojo类的package对不上,导致没建表。

来自炫酷的 NutzCN

@wendal 请问具体应该怎么做呢?是缺少什么插件或环境没有配置么?

@sunhao 不是跟着nutzbook写的吗?

来自炫酷的 NutzCN

@wendal “大大的插入代码或日志按钮都不按”. 关于这句话没太理解.... “大大的..”?

@wendal 哦,demo没跟着做,想直接运行网站看下效果.

跑demo的话,看nutzwk或nutzonekey等等

来自炫酷的 NutzCN

@wendal 前辈,这个demo为啥跑起来这么费劲,比较好的开源工程会让参与者比较方便的部署运行才对。
哎... 这个错误还是不知道怎么fix. 我都是按照流程来的啊?

@sunhao 想直接跑起来的,看nutzwk或nutz onekey

这个帖子说的错误,就是User类缺了@Table注解,导致没有自动建表,所以操作的时候报表不存在.

来自炫酷的 NutzCN

@wendal 我看User类是有注解的啊,我代码是直接拉的源码,没有变动过,理论上不应该缺东西才对啊

@sunhao 你指的源码是哪个?给我地址

来自炫酷的 NutzCN

@sunhao 下载最新的代码

来自炫酷的 NutzCN

@wendal
org.nutz.ioc.IocException: [yvrService, topicSearchService] # FAIL to create Ioc Bean name=[topicSearchService]
...
Caused by: java.lang.RuntimeException: '/data/topic/lucene' should be a directory or don't have permission to create it!

@wendal org.nutz.ioc.IocException: [yvrService, topicSearchService] # FAIL to create Ioc Bean name=[topicSearchService]
...
Caused by: java.lang.RuntimeException: '/data/topic/lucene' should be a directory or don't have permission to create it!

@sunhao 什么操作系统?那是默认建索引的文件夹

来自炫酷的 NutzCN

这个路径的配置文件在 src/main/resources/custom/topic.properties

其他自定义的配置文件也看看

@wendal 终于跑通了,感谢前辈!

我也遇到这个问题了,这个论坛中还有一个哥们也是这个问题,那个哥们只是修改了createTablesInPackage中pojo的位置就好了,我遇到的情况是按照进阶手册来的,但是唯一一点是使用maven,所以创建了conf,最后忘记删除了,但是也直接创建ioc了,并且createTablesInPackage中的bean正确,就是创建不了表,最后把conf从 build path中删除即可

maven下不要手动修改build path哦

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