使用jfinal源码在jetty上运行出错? 400 报错
@JFinal 你好,想跟你请教个问题:
在jetty上跑之后出现了以下问题
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.sql.DriverManager.getCallerClass(Unknown Source)
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Caused by: java.lang.RuntimeException: Error creating logger for class class com.alibaba.druid.proxy.DruidDriver. Cause: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:52)
at com.alibaba.druid.proxy.DruidDriver.<clinit>(DruidDriver.java:52)
... 13 more
Caused by: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:50)
... 14 more
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.druid.proxy.DruidDriver
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.sql.DriverManager.getCallerClass(Unknown Source)
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.druid.proxy.DruidDriver
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.sql.DriverManager.getCallerClass(Unknown Source)
at java.sql.DriverManager.getDriver(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
我的数据库连接配置是这样的
C3p0Plugin cp = new C3p0Plugin("jdbc:mysql://localhost/guard", "root", "root");
me.add(cp);
ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
arp.setShowSql(true);
me.add(arp);
为什么会有这个错误,没有用到druid,为什么错误会和druid相关?
后来我改用druid,配置如下
DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://localhost/guard", "root", "root");
druidPlugin.setInitialSize(3).setMaxActive(10);
me.add(druidPlugin);
// 配置ActiveRecord插件
ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
运行时出现如下错误
java.lang.ExceptionInInitializerError
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.RuntimeException: Error creating logger for class class com.alibaba.druid.pool.DruidAbstractDataSource. Cause: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:52)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:50)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
2013-07-24 18:06:24.531:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/E:/360云盘/WEB项目/kuaijing/WebRoot/}: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.RuntimeException: Error creating logger for class class com.alibaba.druid.pool.DruidAbstractDataSource. Cause: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:52)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:50)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
2013-07-24 18:06:24.531:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@b0bad7: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.RuntimeException: Error creating logger for class class com.alibaba.druid.pool.DruidAbstractDataSource. Cause: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:52)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by:
java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:50)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:117)
at com.jfinal.core.Config.startPlugins(Config.java:88)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:70)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:52)
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:118)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:214)
Caused by: java.lang.RuntimeException: Error creating logger for class class com.alibaba.druid.pool.DruidAbstractDataSource. Cause: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:52)
at com.alibaba.druid.pool.DruidAbstractDataSource.<clinit>(DruidAbstractDataSource.java:75)
... 19 more
Caused by: java.lang.ClassCastException: com.alibaba.druid.support.logging.Log4jImpl cannot be cast to com.alibaba.druid.support.logging.Log
at com.alibaba.druid.support.logging.LogFactory.getLog(LogFactory.java:50)
... 20 more
想问下,这个log类型转换是在jfinal里做的吗,有办法可以解决吗
我用的也是druid,没发现这个问题,源码和所需jar在这里 https://github.com/iveryang/jfinal-bbs
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。