公司老项目连接EnterpriseDB (edb)数据库,因为是老项目,开发环境是:
1,jdk6
2,spring3
3,连接edb
接手后项目启动报错如下:
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:240)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:298)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterC

博客讲述了在使用EnterpriseDB(edb)的老项目中遇到的数据库连接问题,项目环境包括jdk6、spring3。启动时抛出CannotCreateTransactionException,经过排查驱动配置、URL、账号密码、数据库状态、驱动jar包等,问题依然存在。最终发现是由于jdbc驱动版本不匹配导致,将postgresql-8.1-407.jdbc3.jar替换为postgresql-42.2.4.jre6.jar后,问题得到解决。
最低0.47元/天 解锁文章
1197

被折叠的 条评论
为什么被折叠?



