Eclipse failed to connect to Oracle Database: ORA-12505

Source: Internet
Author: User

Eclipse failed to connect to Oracle Database: ORA-12505, error code:

  1. Org. springframework. jdbc. CannotGetJdbcConnectionException: cocould not get JDBC connection; nested exception is java. SQL. SQLException: Listener refused the connection with the following error:
  2. ORA-12505, TNS: listener does not currently know of SID given in connect descriptor
  3. The Connection descriptor used by the client was:
  4. 128.64.96.33: 1522: CLPM0701
  5. Java. SQL. SQLException: Listener refused the connection with the following error:
  6. ORA-12505, TNS: listener does not currently know of SID given in connect descriptor
  7. The Connection descriptor used by the client was:
  8. 128.64.96.33: 1522: CLPM0701
  9. At oracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java: 125)
  10. At oracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java: 280)
  11. At oracle. jdbc. driver. T4CConnection. logon (T4CConnection. java: 319)
  12. At oracle. jdbc. driver. PhysicalConnection. <init> (PhysicalConnection. java: 344)
  13. At oracle. jdbc. driver. T4CConnection. <init> (T4CConnection. java: 148)
  14. At oracle. jdbc. driver. T4CDriverExtension. getConnection (T4CDriverExtension. java: 32)
  15. At oracle. jdbc. driver. OracleDriver. connect (OracleDriver. java: 545)
  16. At java. SQL. DriverManager. getConnection (Unknown Source)
  17. At java. SQL. DriverManager. getConnection (Unknown Source)
  18. At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnectionFromDriverManager (DriverManagerDataSource. java: 234)
  19. At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnectionFromDriverManager (DriverManagerDataSource. java: 220)
  20. At org. springframework. jdbc. datasource. DriverManagerDataSource. getConnection (DriverManagerDataSource. java: 202)
  21. At org. springframework. jdbc. datasource. performanceutils. doGetConnection (performanceutils. java: 146)
  22. At org. springframework. jdbc. datasource. performanceutils. getConnection (performanceutils. java: 100)
  23. At org. springframework. jdbc. datasource. performanceutils. getConnection (performanceutils. java: 76)
  24. At org.springframework.jdbc.core.JdbcTemplate.exe cute (JdbcTemplate. java: 242)
  25. At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 322)
  26. At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 326)
  27. At org. springframework. jdbc. core. JdbcTemplate. query (JdbcTemplate. java: 330)
  28. At org. springframework. jdbc. core. JdbcTemplate. queryForList (JdbcTemplate. java: 361)
  29. At cn. ccb. clpm. common. bizservice. commondbquery. persistence. dao. impl. CommonDBQueryDAOImpl. findBySQL (CommonDBQueryDAOImpl. java: 154)
  30. At cn. ccb. clpm. common. bizservice. commondbquery. bizservice. impl. CommonDBQueryBSImpl. findBySQL (CommonDBQueryBSImpl. java: 38)
  31. At cn. ccb. clpm. bizprocess. loanservice. ieratemodelcalculate. bizservice. impl. ERateModelCalcuBConfigBSImpl. findModelDimensionDefinitionBO (ERateModelCalcuBConfigBSImpl. java: 79)
  32. At bizprocess. loanservice. ERateModelCalcuBConfigBSTest. testFindModelDimensionDefinitionBO (ERateModelCalcuBConfigBSTest. java: 62)
  33. At sun. reflect. NativeMethodAccessorImpl. invoke0 (Native Method)
  34. At sun. reflect. NativeMethodAccessorImpl. invoke (Unknown Source)
  35. At sun. reflect. DelegatingMethodAccessorImpl. invoke (Unknown Source)
  36. At java. lang. reflect. Method. invoke (Unknown Source)
  37. At org. junit. runners. model. FrameworkMethod $1. runReflectiveCall (FrameworkMethod. java: 44)
  38. At org. junit. internal. runners. model. ReflectiveCallable. run (ReflectiveCallable. java: 15)
  39. At org. junit. runners. model. FrameworkMethod. invokeExplosively (FrameworkMethod. java: 41)
  40. At org. junit. internal. runners. statements. InvokeMethod. evaluate (InvokeMethod. java: 20)
  41. At org. junit. internal. runners. statements. RunBefores. evaluate (RunBefores. java: 28)
  42. At org. junit. runners. ParentRunner. runLeaf (ParentRunner. java: 276)
  43. At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 70)
  44. At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 48)
  45. At org. junit. runners. ParentRunner $ 3.run( ParentRunner. java: 244)
  46. At org. junit. runners. ParentRunner $1. schedule (ParentRunner. java: 59)
  47. At org. junit. runners. ParentRunner. runChildren (ParentRunner. java: 242)
  48. At org. junit. runners. ParentRunner. access $000 (ParentRunner. java: 49)
  49. At org. junit. runners. ParentRunner $2. evaluate (ParentRunner. java: 235)
  50. At org. junit. runners. ParentRunner. run (ParentRunner. java: 305)
  51. At org. eclipse. jdt. internal. junit4.runner. JUnit4TestReference. run (JUnit4TestReference. java: 49)
  52. At org. eclipse. jdt. internal. junit. runner. TestExecution. run (TestExecution. java: 38)
  53. At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 467)
  54. At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 683)
  55. At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. run (RemoteTestRunner. java: 390)
  56. 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:

  1. SelectINSTANCE_NAMEFromV $ instance;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.