新手写demo 启动时 c3p0报错 求指导


C3p0Plugin c3p0 = new C3p0Plugin("jdbc:mysql://127.0.0.1/jfinal_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull","root","ADMIN");


感觉像是mysql的jar包的问题 ,但自己导入了mysql的jar包


2017-01-22 16:42:39.259:WARN:oejuc.AbstractLifeCycle:FAILED jfinal: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector

java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector

at com.jfinal.plugin.c3p0.C3p0Plugin.start(C3p0Plugin.java:150)

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

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

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

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

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

at com.jfinal.core.JFinal.main(JFinal.java:176)

Caused by: 

java.lang.ClassNotFoundException: com.mchange.v2.ser.Indirector

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)

at com.jfinal.plugin.c3p0.C3p0Plugin.start(C3p0Plugin.java:150)

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

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

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

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

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

at com.jfinal.core.JFinal.main(JFinal.java:176)


评论区

duoduo

2017-01-22 19:19

java.lang.NoClassDefFoundError从异常来看是没有找到类.c3p0的包引用了?

JFinal

2017-01-22 19:19

在首页下载新的 demo,里面不再使用 c3p0,用的是 druid,你试试

似水流言1

2017-01-23 09:49

你这是2.2还是3.0

过客丶

2017-01-24 12:22

过客丶

2017-01-24 12:23

@duoduo c3p0-0.9.5.1.jar 导入的这个

过客丶

2017-01-24 12:23

过客丶

2017-01-24 12:24

@JFinal 原来的demo 运行没有问题

JFinal

2017-01-24 12:53

@过客丶 直接在首页的右侧下载新版本的 demo,看一眼就知道了

热门反馈

扫码入社