Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

今天下午新checkout出来一项目,结果tomcat部署时报异常:如下

Exception sending context destroyed event to listener instance of class com.dicpsi.mis.contextListener.ContextListener
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested

exception is org.hibernate.exception.GenericJDBCException: Cannot open connection

Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection

Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

 

郁闷了一会,终于发现了一个好低级的错误,jdbc.properties文件中的连接数据库的正确url应该为:

datasource.url=jdbc:oracle:thin:@192.168.0.5:1521:dicpsi

 

而checkout出来的错误的文件为:datasource.url=jdbc:oracle:thin:@localhost:1521:dicpsi     即里面的配置文件的链接地址不应该是@localhost,而应该是@192.168.0.5

 

你可能感兴趣的:(web)