随笔 - 303  文章 - 883  trackbacks - 0
<2007年9月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

欢迎光临! 
闲聊 QQ:1074961813

随笔分类(357)

我管理的群

公共blog

  • n维空间
  • Email : java3d@126.com 群 : 12999758

参与管理的论坛

好友的blog

我的其他blog

朋友的网站

搜索

  •  

最新评论

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [D:\HS_Test\WebRoot\WEB-INF\applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.getDeclaredConstructor(Unknown Source)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:
54)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:
759)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:
724)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
387)
    at org.springframework.beans.factory.support.AbstractBeanFactory$
1.getObject(AbstractBeanFactory.java:251)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
156)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
248)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
160)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
287)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
352)
    at org.springframework.context.support.FileSystemXmlApplicationContext.
<init>(FileSystemXmlApplicationContext.java:93)
    at org.springframework.context.support.FileSystemXmlApplicationContext.
<init>(FileSystemXmlApplicationContext.java:77)
    at org.springframework.context.support.FileSystemXmlApplicationContext.
<init>(FileSystemXmlApplicationContext.java:67)


原因是工具myEclipse在建立SessionFactory的时候,少加一个包 commons-pool-1.3.jar 补上去问题解决。



 



地震让大伙知道:居安思危,才是生存之道。
posted on 2007-09-28 21:59 小寻 阅读(66363) 评论(23)  编辑  收藏 所属分类: 编程问题

FeedBack:
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool[未登录] 2007-10-21 11:42 a
怎么补上去  回复  更多评论
  
# re: <font color="#33cccc">Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool<font> 2007-11-09 11:14 幻想~@@~
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-11-19 20:07 萧雨枫夜
谢谢了  回复  更多评论
  
# 这是什么错误? 2007-11-21 11:19 李飞
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.util.ClassUtils.<clinit>(ClassUtils.java:59)
at org.springframework.core.io.DefaultResourceLoader.<init>(DefaultResourceLoader.java:53)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:170)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:163)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:67)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:49)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:86)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:74)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:65)
at com.elite.jdbctemplate.TestQueryForList.main(TestQueryForList.java:12)
  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-11-21 15:07 何凤英
严重: action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)  回复  更多评论
  
# re: <font color="#33cccc">Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool<font> 2007-11-23 10:34 幻想~@@~
@李飞

你的问题是spring没找到org/apache/commons/logging/LogFactory类 所在的jar包

这个类在一个叫 commons-logging-1.**.jar的包中(该包在你布置hibernate时,工具会自动帮
你加入),如果没找到这个包,请到apache.org下载,再加到工程中。

如果你的工程中已经有了这个包,请检查你的tomcat和jre中是否有这个包,

有的话删除掉,以免因为重复而出现错误。
  回复  更多评论
  
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool" href="/lusm/archive/2007/09/28/149363.html#162563"># re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-11-23 10:52 幻想~@@~

@何凤英

 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver">
  
</property>
  
<property name="url" value="jdbc:oracle:thin:@localhost:1521:oracle">
  
</property>
  
<property name="username" value="user"></property>
  
<property name="password"value="password"></property>
 
</bean>

请看,上面是一个普通的spring配置文件中dataSource bean的jdbc配置部分运行时的报错和你说在初始化这个bean的时候出现问题了。对照一下上面的配置,如果你的配置文件没写错的话,那就是在一下几个地方出了问题:
第一、工程中少了org/apache/commons/pool/impl/GenericObjectPool 所在的包: 这个 类在commons-pool-1.x.jar包中 请去apache官方下载一个,放到工程中。
第二、如果加入之后还出现问题,请检查你的数据库驱动包是否配置正确

  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-11-23 12:53 NO.one
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/bouncycastle/crypto/CipherParameters
Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/crypto/CipherParameters

是什么原因啊?
谢谢

  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-11-24 10:31 幻想~@@~
@NO.one

你出错的原因是,工程中缺少org.bouncycastle.crypto.CipherParameters类所在的jar包

我查了下 该包可以在这里下载到
http://bouncycastle.org/latest_releases.html

请根据你jdk的版本下载相应的包
比如你的jdk是1.6 你可以下载
http://bouncycastle.org/download/bcprov-jdk16-138.jar  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2007-12-06 18:09 11
各位老大,为什么我加了commons-pool-1.3.jar 会出现这样的错误:
Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: Bad version number in .class file
Caused by:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool[未登录] 2007-12-07 16:03 寻觅
UnsupportedClassVersionError
commons-pool-1.3.jar
版本和你的spring不兼容
去下个其他版本就解决了  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2008-03-20 20:55 eager
真的太感谢啦,呵呵,总算解决SSH的架构问题了,可以正常运行了。  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2008-07-17 17:06 unicorn
太感謝你了.......  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool[未登录] 2008-08-21 19:22 h
严重: Parse Error at line 1 column 17: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:250)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3088)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:914)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.commons.digester.Digester.parse(Digester.java:1591)
at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool[未登录] 2008-08-28 15:49 eric
java.lang.NoClassDefFoundError: org/bouncycastle/crypto/CipherParameters
我在j2me上运行模拟机wtk2.5 for cldc运行时出这样的错误,但我已经把这个包加进去了,在模拟器上运行就出现问题,如果在j2me上运行主不出现这样的报错
  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2008-09-16 16:31 eclipse 运行Heritrix类出错
java.lang.NoClassDefFoundError: org/archive/crawler/Heritrix Exception in thread "main"  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2009-10-08 01:42 Пушкин
Ёбнулись вы все иероглифами писать! Пиздец!  回复  更多评论
  
# java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils[未登录] 2011-03-28 22:41 小刚
java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
at org.archive.crawler.settings.XMLSettingsHandler.writeSettingsObject(XMLSettingsHandler.java:260)
at org.archive.crawler.settings.XMLSettingsHandler.writeSettingsObject(XMLSettingsHandler.java:208)
at org.archive.crawler.settings.XMLSettingsHandler.copySettings(XMLSettingsHandler.java:360)
at org.archive.crawler.admin.CrawlJobHandler.createSettingsHandler(CrawlJobHandler.java:889)
at org.archive.crawler.admin.CrawlJobHandler.createNewJob(CrawlJobHandler.java:781)
at org.archive.crawler.admin.CrawlJobHandler.newJob(CrawlJobHandler.java:730)
at org.apache.jsp.new_jsp._jspService(new_jsp.java:185)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)
at org.archive.crawler.admin.ui.RootFilter.doFilter(RootFilter.java:67)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
at org.mortbay.http.HttpServer.service(HttpServer.java:879)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:300)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 29 more  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool[未登录] 2011-03-29 19:35 小刚
上面的错误请高人指点下吧,已经折磨我好久了。  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2012-10-24 16:29 马宗飞
非常感谢,解决了  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2013-11-05 11:25 20YS空间站
你的问题是spring没找到org/apache/commons/logging/LogFactory类 所在的jar包

这个类在一个叫 commons-logging-1.**.jar的包中(该包在你布置hibernate时,工具会自动帮
你加入),如果没找到这个包,请到apache.org下载,再加到工程中。

如果你的工程中已经有了这个包,请检查你的tomcat和jre中是否有这个包,

有的话删除掉,以免因为重复而出现错误。
  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2013-11-05 11:25 春节放假
上面的错误请高人指点下吧,已经折磨我好久了。  回复  更多评论
  
# re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool 2015-11-16 14:46 
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\lenovo>C:\apache-jmeter-2.13\bin\jmeter
java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/Config
urationException
at org.apache.jmeter.JMeter.<clinit>(JMeter.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:262)
Caused by: java.lang.ClassNotFoundException: org.apache.avalon.framework.configu
ration.ConfigurationException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
JMeter home directory was detected as: C:\apache-jmeter-2.13
C:\Users\lenovo>  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: