日期:2014-05-19  浏览次数:20784 次

c3p0问题java.lang.NoClassDefFoundError:com.mchange.v2.ser.Indirector
   我的一个项目是采用SSH框架搭建的,使用的数据库是SQL Server 2005,服务器是tomcat,数据库连接池是c3p0.刚开始时我是用的具体版本是c3p0-0.9.1.1.jar,但是经常在控制台抛出错误:APPARENT DEADLOCK!!! Creating emergency threads for unassigne。我看了网上好多人出现了这样的错误,我也试了好几种方法一直不行,包括把maxStatements属性设置为0也不行。于是就采用c3p0-0.9.2-pre1.jar版本,但是tomcat启动时控制台中就报错:Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector。我在项目中通过右键项目--build path 已经添加了jar包,但是仍然出错误。最近几天一直没解决掉,还请大家指教一下。
   下面是错误的详细内容:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [D:\apache-tomcat-6.0.24\webapps\fwglpt\WEB-INF\classes\spring\applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 94 more
Caused by: java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 105 more
Caused by: java.lang.ClassNotFoundException: com.mchange.v2.ser.Indirector
at  c标签有关问题