728x90
반응형
오라클과 DB연동 도중 다음과 같은 에러가 발생했다.
Failure Trace는 다음과 같다.
java.lang.AssertionError: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
at org.junit.Assert.fail(Assert.java:88)
at com.test.persistence.JDBCTest.testConnection(JDBCTest.java:29)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
해당 오류는 Oracle의 접속 시 SID가 맞지 않는 경우 발생한다.
SID란 윈도우에서 사요자의 계정을 식별하는데 사용되는 보안 식별자를 말한다.
따라서 우선 SQL Developer의 접속 설정을 확인해야한다.
해당 데이터의 오른쪽 마우스를 클릭해서 속성에 들어가면 확인 할 수 있다.
확인해보니 SID 이름이 testdb인데 orcl로 연결하려고 해서 난 에러였다.
예전에 db설치시에 자꾸 에러가 나서 SID를 다르게 설정했던 걸 까먹고 있었음..
저 부분의 orcl부분을 testdb로 변경해주니 제대로 연결되는 것을 확인
728x90
반응형
'Spring' 카테고리의 다른 글
[Springboot] Lombok 의 어노테이션(Annotation) (0) | 2023.01.04 |
---|---|
[Springboot] Lombok 설치, 적용하는 법 (0) | 2023.01.04 |
[Spring] Spring Legacy Project 생성 (0) | 2022.12.28 |
[Spring] error : xml의 Namespaces가 보이지 않을 때 (0) | 2022.12.28 |
[Spring] error : pom.xml 에디터 미인식 시 (0) | 2022.12.28 |
댓글