Invocation of init method failed; nested exception is java.sql.SQLException: Listener refused the connection with the following error:ORA-12519, TNS:no appropriate service handler found

本机启动时,报了这个错误,然后在网上查资料,大部分说的是数据库连接数问题,执行了下述语句

查询当前连接数:select count(*) from v$process;

查询最大连接数:select value from v$parameter where name = 'processes';

然后发现当前连接数并没有超过最大连接数,只是它的三分之一。

然后网上查到资料,执行了下述语句

SELECT osuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machine

from v$session a, v$sqlarea b

where a.sql_address =b.address order by cpu_time/executions desc;

发现了一个问题:用户为oracle的MACHINE字段为mhraz2,而项目中的实例名为mhraz1,然后有执行了下述语句,查看数据库实例名

SELECT instance_name FROM v$instance;

发现果然实例名是mhraz1,更改jdbc.properties中的数据库实例名,然后启动项目,项目启动成功。

 

 

 

 

 

猜你喜欢

转载自www.cnblogs.com/zwl18/p/11224677.html