org.springframework.beans.factory.BeanCreationException_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > org.springframework.beans.factory.BeanCreationException

org.springframework.beans.factory.BeanCreationException

 2011/10/27 8:15:57  alive41  http://alive41.iteye.com  我要评论(0)
  • 摘要:王哥倒过来的整合框架,各种不好使,我深知是自己的问题,上网上找了很多文章终于找到了问题的所在,但是具体怎么解决我还是没有尝试出来。一下是错误异常严重:StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinServletContextresource[/WEB
  • 标签:Framework Spring CTO
王哥倒过来的整合框架,各种不好使,我深知是自己的问题,上网上找了很多文章

终于找到了问题的所在,但是具体怎么解决我还是没有尝试出来。

一下是错误异常


严重: StandardWrapper.Throwable

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:881)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837)

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

    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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

    at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

    at javax.servlet.GenericServlet.init(GenericServlet.java:212)

    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)

    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)

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

    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)

    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)

    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)

    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)

    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)

    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

    at org.apache.catalina.core.StandardService.start(StandardService.java:519)

    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

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

    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


网上对此的解释:
该异常产生的原因:
是因为在将spring框架和hibernate框架进行整合的时候,包冲突所引起的,这个bug在myeclipse6.0的时候就开始产生了,产生冲突的两

个.jar文件是:asm.jar和asm-2.2.3.jar的冲突造成的。

解决方案:视频上说删除asm-2.2.3.jar即可正常运行!
但是我在我的机器删除了以后,却一直还是报上面的错: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

后来我去我的lib目录下又删除了很多的名字相似的.jar文件(删除了能有5,6个.jar文件)但是还是报上面的错,刺激了!


以上是一位大哥写的,我跟他是一样的,不过后来就是他解决了我没解决- -。!!!

看看明天怎么弄,回来补充~
发表评论
用户名: 匿名