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

利用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
=============================================

你可能感兴趣的:(java,apache,spring,Hibernate,bean)