jfinal copy log4j-1.2.16.jar和log4j.properties报错的问题

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

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

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

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

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

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

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

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

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

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

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

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

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:128)

at com.jfinal.core.Config.configPluginWithOrder(Config.java:71)

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

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:133)

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

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

at com.pony.config.Config.main(Config.java:20)

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

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

at sun.reflect.ClassDefiner.defineClass(Unknown Source)

at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)

at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)

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

at sun.reflect.MethodAccessorGenerator.generate(Unknown Source)

at sun.reflect.MethodAccessorGenerator.generateConstructor(Unknown Source)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

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

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

at com.mysql.jdbc.MysqlIO.buildResultSetWithUpdates(MysqlIO.java:3194)

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

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

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

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

at com.mysql.jdbc.ConnectionImpl.setupServerForTruncationChecks(ConnectionImpl.java:5150)

at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3393)

at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2235)

at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)

at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)

at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

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

... 30 more

Starting Complete. Welcome To The JFinal World :)

我用的eclipse 下的启动方式   JFinal.start("WebRoot", 80, "/", 5);


评论区

JFinal

2018-10-04 22:47

部分 eclipse 版本不支持 JFinal.start(...) 的最后一个参数,IDEA 也不支持

可以等 10 月 8 号的 jfinal 3.5 这版本发布后使用,该版本解决了这个问题

也可以先用这个办法解决一下:
http://www.jfinal.com/feedback/2429

谈笑间

2018-10-05 11:08

@JFinal 谢谢波哥

热门反馈

扫码入社