Eclipse failed to connect to Oracle Database: ORA-12505, error code:
- Org. springframework. jdbc. CannotGetJdbcConnectionException: cocould not get JDBC connection; nested exception is java. SQL. SQLException: Listener refused the connection with the following error:
- ORA-12505, TNS: listener does not currently know of SID given in connect descriptor
- The Connection descriptor used by the client was:
- 128.64.96.33: 1522: CLPM0701
- Java. SQL. SQLException: Listener refused the connection with the following error:
- ORA-12505, TNS: listener does not currently know of SID given in connect descriptor
- The Connection descriptor used by the client was:
- 128.64.96.33: 1522: CLPM0701
- At oracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java: 125)
- At oracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java: 280)
- At oracle. jdbc. driver. T4CConnection. logon (T4CConnection. java: 319)
- At oracle. jdbc. driver. PhysicalConnection. <init> (PhysicalConnection. java: 344)
- At oracle. jdbc. driver. T4CConnection. <init> (T4CConnection. java: 148)
- At oracle. jdbc. driver. T4CDriverExtension. getConnection (T4CDriverExtension. java: 32)
- At oracle. jdbc. driver. OracleDriver. connect (OracleDriver. java: 545)
- At java. SQL. DriverManager. getConnection (Unknown Source)
- At java. SQL. DriverManager. getConnection (Unknown Source)
- At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnectionFromDriverManager (DriverManagerDataSource. java: 234)
- At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnectionFromDriverManager (DriverManagerDataSource. java: 220)
- At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 202)
- At org. springframework. jdbc. datasource. performanceutils. doGetConnection (performanceutils. java: 146)
- At org. springframework. jdbc. datasource. performanceutils. getConnection (performanceutils. java: 100)
- At org. springframework. jdbc. datasource. performanceutils. getConnection (performanceutils. java: 76)
- At org.springframework.jdbc.core.JdbcTemplate.exe cute (JdbcTemplate. java: 242)
- At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 322)
- At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 326)
- At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 330)
- At org. springframework. jdbc. core. JdbcTemplate. queryForList (JdbcTemplate. java: 361)
- At cn. ccb. clpm. common. bizservice. commondbquery. persistence. dao. impl. CommonDBQueryDAOImpl. findBySQL (CommonDBQueryDAOImpl. java: 154)
- At cn. ccb. clpm. common. bizservice. commondbquery. bizservice. impl. CommonDBQueryBSImpl. findBySQL (CommonDBQueryBSImpl. java: 38)
- At cn. ccb. clpm. bizprocess. loanservice. ieratemodelcalculate. bizservice. impl. ERateModelCalcuBConfigBSImpl. findModelDimensionDefinitionBO (ERateModelCalcuBConfigBSImpl. java: 79)
- At bizprocess. loanservice. ERateModelCalcuBConfigBSTest. testFindModelDimensionDefinitionBO (ERateModelCalcuBConfigBSTest. java: 62)
- 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. junit. runners. model. FrameworkMethod $1. runReflectiveCall (FrameworkMethod. java: 44)
- At org. junit. internal. runners. model. ReflectiveCallable. run (ReflectiveCallable. java: 15)
- At org. junit. runners. model. FrameworkMethod. invokeExplosively (FrameworkMethod. java: 41)
- At org. junit. internal. runners. statements. InvokeMethod. evaluate (InvokeMethod. java: 20)
- At org. junit. internal. runners. statements. RunBefores. evaluate (RunBefores. java: 28)
- At org. junit. runners. ParentRunner. runLeaf (ParentRunner. java: 276)
- At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 70)
- At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 48)
- At org. junit. runners. ParentRunner $ 3.run( ParentRunner. java: 244)
- At org. junit. runners. ParentRunner $1. schedule (ParentRunner. java: 59)
- At org. junit. runners. ParentRunner. runChildren (ParentRunner. java: 242)
- At org. junit. runners. ParentRunner. access $000 (ParentRunner. java: 49)
- At org. junit. runners. ParentRunner $2. evaluate (ParentRunner. java: 235)
- At org. junit. runners. ParentRunner. run (ParentRunner. java: 305)
- At org. eclipse. jdt. internal. junit4.runner. JUnit4TestReference. run (JUnit4TestReference. java: 49)
- At org. eclipse. jdt. internal. junit. runner. TestExecution. run (TestExecution. java: 38)
- At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 467)
- At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 683)
- At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. run (RemoteTestRunner. java: 390)
- At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. main (RemoteTestRunner. java: 197)
Solution: Modify the applicationContext configuration file used for testing and change the service name value in the JDBC database configuration to the sid name value.
View the current sid name in the database:
- SelectINSTANCE_NAMEFromV $ instance;