开发者社区> 问答> 正文

使用jfinal源码在jetty上运行出错? 400 报错

使用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里做的吗,有办法可以解决吗

展开
收起
爱吃鱼的程序员 2020-05-29 18:21:52 569 0
1 条回答
写回答
取消 提交回答
  • 我用的也是druid,没发现这个问题,源码和所需jar在这里 https://github.com/iveryang/jfinal-bbs

    2021-02-21 00:58:28
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第7讲】:Spring Boot 2.0安全机制与MVC身份验证实战(Java面试题) 立即下载
Java Spring Boot开发实战系列课程(第17讲):Spring Boot 2.0实战Docker容器Linux 立即下载
Java Spring Boot开发实战系列课程【第6讲】:Spring Boot 2.0实战MyBatis与优化(Java面试题) 立即下载