未知的休眠错误,连接池问题

时间:2013-10-01 08:33:39

标签: java web-services hibernate c3p0 pool

我在使用hibernate在tomcat服务器(6.0)上运行程序时遇到问题。我不确切地知道它来自哪里。我认为这是关于hibernate连接池问题,比如没有关闭连接。我没有在互联网上找到任何关于那个的东西,所以我来这里。你有什么主意吗? 感谢,

的Al。

2013-09-19 10:49:05,806 INFO  dadvi.imoa.struts.actions.ged.DocumentAction - 2751
2013-09-19 16:09:49,868 INFO  org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Wed Sep 18 17:04:12 CEST 2013]; root of context hierarchy
2013-09-19 16:09:49,871 INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@692c1bef: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,securityInterceptor,cxf.config0,CreationCompteWS,DocumentWS,deviceAuthServiceClass,documentServiceClass,scanServiceClass,directoryServiceClass,deviceInterceptor,scanService,directoryService,deviceAuthService,documentService,directoryServiceWS]; root of factory hierarchy
2013-09-19 16:09:49,884 INFO  dadvi.imoa.listener.SpoolListener - Starting to stop.
2013-09-19 16:09:49,884 INFO  dadvi.imoa.listener.SpoolListener - Finished to stop.
2013-09-19 16:09:50,790 ERROR dadvi.imoa.utils.HibernateUtils - Error while hibernate connexion :
org.hibernate.exception.GenericJDBCException: Cannot open connection
                at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
                at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
                at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
                at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
                at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
                at dadvi.imoa.utils.HibernateUtils.startHibernateTransaction(HibernateUtils.java:53)
                at dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl.getClientByNumClient(ClientsDadviDAOImpl.java:86)
                at dadvi.imoa.struts.actions.SubscriptionAction.<clinit>(SubscriptionAction.java:83)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NullPointerException
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531)
                at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
                at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 30 more
Caused by: java.lang.NullPointerException
                at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:255)
                at com.mchange.v2.resourcepool.BasicResourcePool.trace(BasicResourcePool.java:1639)
                at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:492)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
                ... 33 more
2013-09-19 16:09:50,793 ERROR dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl -  >>> Error while searching client by numClient :
java.lang.NullPointerException
                at dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl.getClientByNumClient(ClientsDadviDAOImpl.java:93)
                at dadvi.imoa.struts.actions.SubscriptionAction.<clinit>(SubscriptionAction.java:83)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
2013-09-19 16:09:50,795 ERROR dadvi.imoa.utils.HibernateUtils - Error while hibernate connexion :
org.hibernate.exception.GenericJDBCException: Cannot open connection
                at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
                at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
                at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
                at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
                at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
                at dadvi.imoa.utils.HibernateUtils.startHibernateTransaction(HibernateUtils.java:53)
                at dadvi.imoa.dao.cgv.impl.CgvDAOImpl.actualCgv(CgvDAOImpl.java:22)
                at dadvi.imoa.struts.actions.SubscriptionAction.<clinit>(SubscriptionAction.java:84)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NullPointerException
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531)
                at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
                at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 30 more
Caused by: java.lang.NullPointerException
                at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:255)
                at com.mchange.v2.resourcepool.BasicResourcePool.trace(BasicResourcePool.java:1639)
                at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:492)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
                ... 33 more
2013-09-19 16:09:50,805 ERROR dadvi.imoa.utils.HibernateUtils - Error while hibernate connexion :
org.hibernate.exception.GenericJDBCException: Cannot open connection
                at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
                at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
                at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
                at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
                at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
                at dadvi.imoa.utils.HibernateUtils.startHibernateTransaction(HibernateUtils.java:53)
                at dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl.getClientByNumClient(ClientsDadviDAOImpl.java:86)
                at dadvi.imoa.struts.actions.DialogAction.<clinit>(DialogAction.java:51)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NullPointerException
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531)
                at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
                at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 30 more
Caused by: java.lang.NullPointerException
                at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:255)
                at com.mchange.v2.resourcepool.BasicResourcePool.trace(BasicResourcePool.java:1639)
                at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:492)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
                ... 33 more
2013-09-19 16:09:50,806 ERROR dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl -  >>> Error while searching client by numClient :
java.lang.NullPointerException
                at dadvi.imoa.dao.clientdadvi.impl.ClientsDadviDAOImpl.getClientByNumClient(ClientsDadviDAOImpl.java:93)
                at dadvi.imoa.struts.actions.DialogAction.<clinit>(DialogAction.java:51)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
2013-09-19 16:09:50,808 ERROR dadvi.imoa.utils.HibernateUtils - Error while hibernate connexion :
org.hibernate.exception.GenericJDBCException: Cannot open connection
                at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
                at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
                at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
                at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
                at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
                at dadvi.imoa.utils.HibernateUtils.startHibernateTransaction(HibernateUtils.java:53)
                at dadvi.imoa.dao.cgv.impl.CgvDAOImpl.actualCgv(CgvDAOImpl.java:22)
                at dadvi.imoa.struts.actions.DialogAction.<clinit>(DialogAction.java:52)
                at sun.misc.Unsafe.ensureClassInitialized(Native Method)
                at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
                at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
                at java.lang.reflect.Field.get(Unknown Source)
                at org.apache.catalina.loader.WebappClassLoader.clearReferencesStaticFinal(WebappClassLoader.java:2066)
                at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1929)
                at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
                at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
                at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
                at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
                at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
                at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NullPointerException
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
                at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531)
                at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
                at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:78)
                at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 30 more
Caused by: java.lang.NullPointerException
                at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:255)
                at com.mchange.v2.resourcepool.BasicResourcePool.trace(BasicResourcePool.java:1639)
                at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:492)
                at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
                ... 33 more
2013-09-19 16:10:50,689 INFO  dadvi.imoa.listener.SpoolListener - Starting.
2013-09-19 16:10:50,689 INFO  dadvi.imoa.listener.SpoolListener - Stopping.

4 个答案:

答案 0 :(得分:0)

通用JDBC异常:无法打开连接

连接到数据库时出现问题,导致

。 请检查您的JDBC连接代码。

答案 1 :(得分:0)

无法打开连接:看起来您的项目已丢失与数据库的连接。 我曾经多次(非生产)环境,帮助我解决它的问题,就是重新启动我工作的Tomcat服务器

答案 2 :(得分:0)

这可能有很多原因,如果没有进一步的信息,就无法分辨。

  • 连接字符串是否正确
  • 登录名和密码是否正确
  • 您是否拥有数据库
  • 的权限
  • 您的xml文件是否正确

答案 3 :(得分:0)

异常的原因是堆栈跟踪结束时的java.lang.NullPointerException。所以我用谷歌搜索了“c3p0”和“Log4jMLog”,第一个搜索结果是一个开放bug的链接,它描述了你的情况。看起来你遇到了同样的错误(2007年报道,我不得不承认这有点可疑 - 现在应该已经解决了。)