`
lzstone
  • 浏览: 94096 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

利用spring+hibernate配置dbcp连接池配置的异常解析

    博客分类:
  • java
阅读更多

利用spring+hibernate配置dbcp连接池配置过程出现的异常解析
首先导入spring,hibernate的jar包
hibernate-distribution-3.3.2.GA-dist
spring-framework-2.5.6.SEC01-with-dependencies
建立applicationContext.xml,配置web.xml启动
=============================================
严重: Error listenerStart
2009-11-10 13:36:44 org.apache.catalina.core.StandardContext start
严重: Context [/dream] startup failed due to previous errors
2009-11-10 13:36:45 org.apache.coyote.http11.Http11Protocol start
缺少:commons-logging.jar
=============================================
导入commons-dbcp.jar配置连接池
=============================================
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationCont
ext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDef
FoundError: org/apache/commons/pool/impl/GenericObjectPool
缺少:commons-pool.jar
=============================================
=============================================
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Instantiation of bean failed; nested exception is org.springframew
ork.beans.BeanInstantiationException: Could not instantiate bean class [org.spri
ngframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception
; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentExceptio
n
缺少:dom4j.jar
=============================================
=============================================
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Instantiation of bean failed; nested exception is org.springframew
ork.beans.BeanInstantiationException: Could not instantiate bean class [org.spri
ngframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception
; nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
缺少:slf4j-api.jar
=============================================
=============================================
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Instantiation of bean failed; nested exception is org.springframew
ork.beans.BeanInstantiationException: Could not instantiate bean class [org.spri
ngframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception
; nested exception is java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLogge
rBinder
缺少:slf4j-log4j12.jar
=============================================
=============================================
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Instantiation of bean failed; nested exception is org.springframew
ork.beans.BeanInstantiationException: Could not instantiate bean class [org.spri
ngframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception
; nested exception is java.lang.NoClassDefFoundError: org/apache/log4j/Level
缺少:log4j.jar
=============================================
=============================================
log4j:WARN No appenders could be found for logger (org.springframework.core.Coll
ectionFactory).
log4j:WARN Please initialize the log4j system properly.
缺少:log4j.properties
=============================================

=============================================
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Initialization of bean failed; nested exception is java.lang.NoCla
ssDefFoundError: javax/transaction/TransactionManager
缺少:jta.jar
=============================================

=============================================
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Invocation of init method failed; nested exception is java.lang.No
ClassDefFoundError: org/apache/commons/collections/map/LRUMap
缺少:commons-collections.jar
=============================================
=============================================
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'sessionFactory' defined in ServletContext resource [/WEB-INF/application
Context.xml]: Invocation of init method failed; nested exception is org.hibernat
e.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tupl
e.entity.PojoEntityTuplizer]
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(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.finish
BeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
429)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
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:5
16)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tupli
zer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:110)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTupl
izer(EntityTuplizerFactory.java:135)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(E
ntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.jav
a:323)
at org.hibernate.persister.entity.AbstractEntityPersister.(Abstrac
tEntityPersister.java:456)
at org.hibernate.persister.entity.SingleTableEntityPersister.(Sing
leTableEntityPersister.java:131)
at org.hibernate.persister.PersisterFactory.createClassPersister(Persist
erFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:
267)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1341)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSession
Factory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessi
onFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPr
opertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 30 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(En
tityTuplizerFactory.java:107)
... 43 more
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactory
Factory(BytecodeProviderImpl.java:49)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryIntern
al(PojoEntityTuplizer.java:208)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoE
ntityTuplizer.java:186)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEnti
tyTuplizer.java:151)
at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTupliz
er.java:78)
... 48 more
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 53 more
缺少:javassist.jar
=============================================
=============================================
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.m
ysql.jdbc.Driver'
缺少:mysql-connector-java-bin.jar
=============================================

分享到:
评论

相关推荐

    Spring+Hibernate+Proxool连接池

    在这个场景下,我们需要配置Spring来管理Hibernate SessionFactory,并且配置Proxool作为我们的数据库连接池。 在`applicationContext.xml`中,你需要为Hibernate配置SessionFactory,如下所示: ```xml ...

    spring3+hibernate4+springmvc+druid连接池

    【标题】"spring3+hibernate4+springmvc+druid连接池"是一个常见的Java Web开发中的技术栈整合,其中包含了Spring框架的三个主要组件:Spring Core、Spring MVC和Hibernate ORM,以及Druid数据库连接池。这个组合常...

    Spring 4.0.6+Hibernate 4.3.5 + Jpa+DBCP2

    在Spring中配置DBCP2作为数据源,可以实现连接池的自动化管理,提高系统性能。 具体整合步骤如下: 1. 添加依赖:在项目中引入Spring、Hibernate、JPA和DBCP2的相关库文件,例如lib-spring 4.0.6、Hibernate 4.3.5...

    struts1+spring+hibernate所需jar包

    4. **其他依赖**: 整合这三个框架时,还需要一些共用的库,如`commons-logging.jar`(日志接口)、`log4j.jar`(日志实现)、`commons-dbcp.jar`或`c3p0.jar`(数据库连接池)、`jta.jar`(Java Transaction API)等...

    Spring+SpringMVC +Hibernate 整合

    5. 数据源配置:在Spring配置文件中,配置DataSource,可以使用DBCP、C3P0等连接池,或者使用JNDI查找数据源。 6. 事务管理:Spring 提供了声明式事务管理,可以在配置文件中声明事务边界,由Spring自动管理事务的...

    HibernateADD (hibernate和spring整合,使用dbcp连接池方式连接数据库)

    在IT行业中,数据库连接管理是应用系统开发中的关键环节,特别是在使用Java进行企业级开发时。...总之,整合Hibernate、Spring和DBCP连接池,可以构建出一个高效、灵活、易于维护的企业级数据库应用。

    spring+Hibernate

    这通常通过`DataSource` bean来实现,可以是内置的如`org.springframework.jdbc.datasource.DriverManagerDataSource`,也可以是连接池如Apache Commons DBCP或HikariCP。 2. **SessionFactory配置**:创建`...

    spring+hibernate整合jar包

    - commons-dbcp或tomcat-jdbc:数据库连接池,优化数据库资源的管理。 4. **Spring JDBC和Hibernate整合**: - Spring通过DataSourceTransactionManager和HibernateTransactionManager来管理事务,前者适用于基本...

    spring3+hibernate4+struts2+dbcp+mysql+json+ehcache+dom4j 合集包

    4. **DBCP连接池**:Apache Commons DBCP是Apache提供的数据库连接池组件,用于管理和复用数据库连接,提高系统性能。它能够有效减少频繁创建和关闭数据库连接带来的开销。 5. **MySQL数据库**:MySQL是一种广泛...

    struts+spring+hibernate

    常见的数据库连接池有Apache的DBCP、C3P0,以及HikariCP等,Spring框架提供了与这些连接池的集成,便于开发者配置和使用。 综上所述,"struts+spring+hibernate"的整合实现了Web应用的模型、视图、控制器分离,提供...

    使用Struts + Spring + Hibernate完成分页笔记

    Spring框架支持多种DataSource实现,例如Apache的Commons DBCP或C3P0,这些连接池可以自动管理数据库连接的生命周期,避免频繁的创建和销毁连接带来的开销。 回顾一下JSP分页的两种常见方式:真分页和假分页。真...

    Spring+Hibernate构建开发环境

    在Spring配置文件中,我们需要定义数据源的bean,这通常使用JDBC驱动或者连接池如Apache DBCP或C3P0。配置包括数据库URL、用户名、密码等信息。 6. **配置Hibernate SessionFactory** 创建Hibernate的...

    Spring+hibernate 所用的jar包大全

    - commons-dbcp或c3p0:数据库连接池,提高数据库连接的复用效率。 - jta或jboss-transaction-api:JTA(Java Transaction API)实现,用于分布式事务处理。 - slf4j-api和相应的实现:日志记录框架,如logback、...

    spring +struts2+hibernate3整合的jar包集合

    这个"spring + struts2 + hibernate3整合的jar包集合"提供了这三个框架的核心库,以及c3p0和DBCP数据库连接池的依赖,使得开发者可以快速搭建一个完整的MVC架构应用。 Spring框架是一个全面的后端解决方案,它提供...

    Struts+Spring+Hibernate 整合教程

    配置连接池参数。 - **3.3 配置SessionFactory**:SessionFactory 是 Hibernate 的核心组件之一,通过Spring可以方便地配置和管理SessionFactory。 - **步骤**: 1. 在Spring配置文件中定义SessionFactory Bean...

    webwork2.2.7+spring+hibernate用到的包lib

    这两个Apache Commons库分别提供了数据库连接池(DBCP)和对象池服务,它们能有效地管理和复用数据库连接,提高系统性能。 `commons-collections.jar`是Apache Commons Collections库,提供了丰富的集合操作和算法...

    Struts2.1.8+Hibernate3.3+Spring3.0环境搭建

    Spring的核心配置文件`applicationContext.xml`用来管理bean的定义和依赖关系,以及数据库连接池配置。这里需要配置数据源、事务管理器以及其他需要的bean。 4. **数据库连接池** 如Apache的Commons DBCP和MySQL...

    连接池与Spring,Hibernate结合

    这里我们将深入探讨连接池的概念,Spring框架中的数据源配置,以及Hibernate的集成,以及它们如何协同工作。 首先,连接池是一种资源管理技术,用于存储数据库连接。它预先创建一定数量的数据库连接,当应用需要时...

    DBCP连接池

    在SSH(Spring、Struts和Hibernate)这样的经典企业级开发框架中,DBCP连接池是一个常用的数据库管理工具。 1. **数据库连接池概念**:数据库连接池是在应用服务器启动时创建的,它会预先建立一定数量的数据库连接...

    struts22.3.4.1+hibernate4.1.6+spring3.1.2整合jar包

    "连接池"可能是Apache Commons DBCP或C3P0,这些是管理数据库连接的组件,可以提高应用程序的性能和资源利用率。"poi"则指的是Apache POI项目,它允许Java程序读写Microsoft Office格式的文件,如Excel,这对于数据...

Global site tag (gtag.js) - Google Analytics