当前位置: 代码迷 >> J2EE >> ORACLE联接失败
  详细解决方案

ORACLE联接失败

热度:25   发布时间:2016-04-22 00:41:59.0
ORACLE连接失败
使用环境:oracle 10g,tomcat6.0。
连接方式
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.username=001
jdbc.url=jdbc\:oracle\:thin\:@localhost\:1521\:ORCL
jdbc.password=001
pool.maxActive=20
pool.maxIdle=5

------------------------------------------
错误提示:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)

root cause

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541)
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy8.getUserByMap(Unknown Source)

root cause

org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)


------解决方案--------------------
用pl/sql连localhost看看可以不。
------解决方案--------------------
探讨

PL sql 和 sql*plus都能连上。用户名密码和端口都没错。。。。。


------解决方案--------------------
应该是Spring配置文件有问题。
代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317
  相关解决方案