在做spring和hibernate整合时,启动报错了,内容如下:
-
java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().
-
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:417)
-
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.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:327)
-
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
-
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:510)
-
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:486)
-
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:742)
-
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:455)
-
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1090)
-
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:487)
-
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
-
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
-
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
-
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
-
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
-
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
-
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
-
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
-
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)
-
16:16:01,797 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@5d9d277e closed by a client.
-
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
-
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
-
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
-
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
-
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
-
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
-
16:16:01,799 ERROR main org.springframework.web.context.ContextLoader - Context initialization failed
-
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring-all.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
-
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
-
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
-
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
-
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
-
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
-
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
-
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
-
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
-
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
-
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
-
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
-
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
-
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
-
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
-
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
-
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)
-
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:108)
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133)
-
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
-
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:322)
-
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:485)
-
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133)
-
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
-
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:286)
-
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
-
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:863)
-
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:782)
-
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
-
... 27 more
-
Caused by: java.lang.reflect.InvocationTargetException
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
-
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
-
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105)
-
... 40 more
-
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
-
at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:205)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:183)
-
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:167)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:77)
-
... 45 more
-
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
-
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
-
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
-
... 50 more
-
16:16:01,799 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@5d9d277e
-
16:16:01,801 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@5d9d277e
-
16:16:01,801 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@9d8643e
-
16:16:01,801 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@9d8643e
-
16:16:01,802 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@9d8643e closed by a client.
-
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
-
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
-
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
-
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
-
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
-
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
-
16:16:01,802 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@9d8643e
-
16:16:01,802 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@9d8643e
-
16:16:01,802 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@5552e7a4
-
16:16:01,803 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@5552e7a4
-
16:16:01,804 DEBUG Resource Destroyer in BasicResourcePool.close() com.mchange.v2.c3p0.impl.NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@5552e7a4 closed by a client.
-
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
-
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
-
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
-
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
-
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
-
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
-
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
-
2014-6-12 16:16:01 org.apache.catalina.core.StandardContext listenerStart
-
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
-
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring-all.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
-
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
-
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
-
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
-
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
-
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
-
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
-
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
-
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
-
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
-
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
-
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
-
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
-
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
-
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
-
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
-
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
-
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
-
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)
-
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:108)
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133)
-
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
-
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:322)
-
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:485)
-
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133)
-
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
-
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:286)
-
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
-
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:863)
-
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:782)
-
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
-
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
-
... 27 more
-
Caused by: java.lang.reflect.InvocationTargetException
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
-
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
-
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
-
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105)
-
... 40 more
-
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
-
at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:205)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:183)
-
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:167)
-
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:77)
-
... 45 more
-
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
-
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
-
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
-
... 50 more
解决方式是增加缺少的依赖,配置如下:
-
<dependency>
-
<groupId>javassist</groupId>
-
<artifactId>javassist</artifactId>
-
<version>3.9.0.GA</version>
-
</dependency>
阅读(5049) | 评论(0) | 转发(1) |