Jfinal连接Linux数据库翻车,老司机带带我

Jfinal WEB项目c3p0Plugin连接数据库时,数据库是在centos7上面的,每次启动都报找不到数据表的错误,然后我系统换成了WindosServer的就不会报错。

centos7启动Tomcat报错信息:

Can not create Table object, maybe the table Customer_Info is not exists.

2018-1-24 20:30:42 org.apache.catalina.core.StandardContext filterStart

严重: Exception starting filter jfinal

java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 

java.sql.SQLException: Base table or view not found,  message from server: "Table 'fruit.Customer_Info' doesn't exist"

at com.jfinal.core.Config.startPlugins(Config.java:97)

at com.jfinal.core.Config.configJFinal(Config.java:49)

at com.jfinal.core.JFinal.init(JFinal.java:62)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)

at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

at org.apache.catalina.core.StandardService.start(StandardService.java:516)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

at org.apache.catalina.startup.Catalina.start(Catalina.java:566)

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

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

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

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

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Caused by: com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: Base table or view not found,  message from server: "Table 'fruit.Customer_Info' doesn't exist"

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:54)

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:225)

at com.jfinal.core.Config.startPlugins(Config.java:88)

... 30 more

Caused by: java.sql.SQLException: Base table or view not found,  message from server: "Table 'fruit.Customer_Info' doesn't exist"

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)

at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1218)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2233)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2181)

at com.mysql.jdbc.Statement.executeQuery(Statement.java:1158)

at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:35)

at com.jfinal.plugin.activerecord.TableBuilder.doBuild(TableBuilder.java:70)

at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:46)

... 32 more

2018-1-24 20:30:42 org.apache.catalina.core.StandardContext start

严重: Error filterStart

2018-1-24 20:30:42 org.apache.catalina.core.StandardContext start

严重: Context [/Hbuild] startup failed due to previous errors

Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.NullPointerException

at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:551)

Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.NullPointerException

at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:551)

2018-1-24 20:30:42 org.apache.coyote.http11.Http11Protocol start

信息: Starting Coyote HTTP/1.1 on http-8080

2018-1-24 20:30:42 org.apache.jk.common.ChannelSocket init

信息: JK: ajp13 listening on /0.0.0.0:8009

2018-1-24 20:30:42 org.apache.jk.server.JkMain start

信息: Jk running ID=0 time=0/25  config=null

2018-1-24 20:30:42 org.apache.catalina.startup.Catalina start

信息: Server startup in 2832 ms

Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" java.lang.NullPointerException

at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:551)

Exception in thread "Timer-0" java.lang.NullPointerException

at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:606)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)


评论区

JFinal

2018-01-24 20:51

在 windows 上开的时候,表名是不区分大小写,而在 Linux 中是区分的,表名建议全部改为小写字母。当然,也可以通过配置 mysql 来解决,不建议这么做

大大酥

2018-01-24 21:01

@JFinal 学习了,谢谢

杜福忠

2018-01-24 21:03

温馨提示: 还需要注意 文件的路径,windows 不区分大小写,而在 Linux 中是区分的, 建议全部小写,用_下划线隔开单词_a_b_c_d_2_3_3_3

大大酥

2018-01-24 21:05

@杜福忠 好的好的,三口三口

热门反馈

扫码入社