eclipse导入jfinal_demo后,无法采用正常eclipse方式(1)启动,必须要用第二种推荐idea的方式(2)启动,报错如下。请问问题可能出现在哪里?
java version:1.8.0_121
eclipse: Oxygen.2 Release (4.7.2)
影响不大,不过每次部署和上传代码的时候都需要特别谨慎别把Config.java传上去,很烦。搜索了很久也没找到相关的解决办法。
1. JFinal.start("WebRoot", 80, "/", 5);
2. JFinal.start("WebRoot", 80, "/");
Starting JFinal 3.3 Starting scanner at interval of 5 seconds. Starting web server on port: 80 2018-02-02 09:11:11.568:WARN:oejuc.AbstractLifeCycle:FAILED jfinal: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor1 cannot access its superclass sun.reflect.ConstructorAccessorImpl 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(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:425) at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:342) at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3129) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3112) 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.execSQL(ConnectionImpl.java:2441) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3008) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:145) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:83) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:735) 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:51) 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.demo.common.DemoConfig.main(DemoConfig.java:38) 2018-02-02 09:11:11.569:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/C:/work/eclipse_workspace/jfinal_demo/WebRoot/}: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor1 cannot access its superclass sun.reflect.ConstructorAccessorImpl 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(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:425) at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:342) at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3129) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3112) 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.execSQL(ConnectionImpl.java:2441) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3008) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:145) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:83) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:735) 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:51) 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.demo.common.DemoConfig.main(DemoConfig.java:38) 2018-02-02 09:11:11.569:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@50a7bc6e: java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor1 cannot access its superclass sun.reflect.ConstructorAccessorImpl 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(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:425) at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:342) at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3129) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3112) 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.execSQL(ConnectionImpl.java:2441) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3008) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:145) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:83) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:735) 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:51) 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.demo.common.DemoConfig.main(DemoConfig.java:38) Exception in thread "main" 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(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:425) at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:342) at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:3129) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3112) 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.execSQL(ConnectionImpl.java:2441) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3008) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:145) at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:83) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:735) 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:51) 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.demo.common.DemoConfig.main(DemoConfig.java:38)
项目:JFinal