为什么我只要配置configPlugin就会报错

其他配置都和官方的jfinal_demo_for_maven模版一样的,就是在配置好configPlugin之后运行项目就会报下面的错,求大神帮帮忙!谢谢!


Starting JFinal 3.2

Starting scanner at interval of 5 seconds.

Starting web server on port: 8080


2017-11-17 13:42:35

[ERROR]-[Thread: main]-[com.alibaba.druid.pool.DruidDataSource.init()]: init datasource error, url: jdbc:mysql://localhost/hucai?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull

java.sql.SQLException: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor2 cannot access its superclass sun.reflect.ConstructorAccessorImpl

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:435)

at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)

at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148)

at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:220)

at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1463)

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1525)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:734)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1060)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1056)

at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:104)

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

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

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

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

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

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

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:157)

at com.hucai.common.MyConfig.main(MyConfig.java:65)


2017-11-17 13:42:35

[ERROR]-[Thread: main]-[com.jfinal.core.Config.startPlugins()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 

java.sql.SQLException: Error

com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: Error

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

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

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

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

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

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

at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:131)

at com.jfinal.server.JettyServer.start(JettyServer.java:70)

at com.jfinal.core.JFinal.start(JFinal.java:157)

at com.hucai.common.MyConfig.main(MyConfig.java:65)

Caused by: java.sql.SQLException: Error

at com.alibaba.druid.pool.DruidDataSource.handleConnectionException(DruidDataSource.java:1330)

at com.alibaba.druid.pool.DruidPooledConnection.handleException(DruidPooledConnection.java:136)

at com.alibaba.druid.pool.DruidPooledStatement.checkException(DruidPooledStatement.java:65)

at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:151)

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

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

... 20 more

Caused by: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor3 cannot access its superclass sun.reflect.ConstructorAccessorImpl

at sun.misc.Unsafe.defineClass(Native Method)

at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)

at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)

at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)

at java.security.AccessController.doPrivileged(Native Method)

at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)

at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:383)

at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3140)

at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:491)

at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3118)

at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2288)

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

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2627)

at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1556)

at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2363)

at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481)

at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302)

at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360)

at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:211)

at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:140)

... 22 more


评论区

JFinal

2017-11-17 14:02

看是不是这个问题: http://www.jfinal.com/feedback/2429

jarvanLee

2017-11-17 14:08

@JFinal 就是这个问题。谢谢了!

热门反馈

扫码入社