본문 바로가기
데이터노트/OracleDB

oracledb를 wallet으로 jdbc접근시 에러 : ONS in FanManager failed with oracle.ons.NoServersAvailable: Subscription time out

by 테크한스 2023. 2. 12.

오라클 프리티어에서 ATP 데이터베이스를 생성한 후에 

 

누구나 2가지는 커넥션 테스트를 할 것이다. 

 

1) sql developer 디비툴에서 접속하는 것 (DBeaver 는 나중에 )

2) jdbc java sample source로 접속해 보는 것이다.

 

첫번째 oracle sql developer 에서는 아주 쉽게 wallet을 이용해 접속이 가능했다.

 

두번째 jdbc java sample source 테스트는 아주 힘겨웠다.

 

우선 관련 설정은 jdk설치, jdbc 라이브러리 그리고 샘플소스를 아래와 같이 제공 받는다

 

https://www.oracle.com/database/technologies/java-connectivity-to-atp.html

 

Java connectivity to ATP

Download JDK81 or higher JDK versions Note : If you are using JDK11, JDK10, or JDK9 then you don't need anything. If your JDK version is less than JDK8u162 then download the JCE Unlimited Strength Jurisdiction Policy Files. Refer to the README for installa

www.oracle.com

 

자바 jdk 1.8 에서 오라클클라우드 ATP 디비를 접속하기 위해서는 ojdbc8.jar만 있어서는 안된다.

(자바 jdk 11 인 경우는 ojdbc10.jar를 받아야 한다)

그냥 아래 항목에서 ojdbc8-full.tar.gz 를 다운받아서 통째로 클래스 라이브러리에 임포트한다.

 

 

요런 느낌으로 말이다. ojdbc8.jar 하나만으로 접속 근처에도 못간다.

 

몽땅 라이브러리에 넣어서 실행하면 먼가 ㅋㅋㅋ 간신히 ㅋㅋㅋ

 

접속은 된다. 접속은 되나 초기에 타임아웃으로 시간이 소요가 된다.

 

이렇게 되면 사용할 수 없다.

 

오후 oracle.simplefan.impl.FanManager configure 
심각: attempt to configure ONS in FanManager failed with oracle.ons.NoServersAvailable: Subscription time out

Driver Name: Oracle JDBC driver
Driver Version: 19.18.0.0.0
Default Row Prefetch Value is: 20
Database Username is: ADMIN

instance_name  version  edition  database_type
---------------------
feyk1pod2 19.0.0.0.0 EE RAC

 

먼가 되는 거 같은데 안되는 경우 

 

이런 이슈는 옵션이 있을 꺼야 하고 묵묵히 구글링하는 수밖에 없습니다.

 

https://github.com/daust/JasperReportsIntegration/issues/69

 

Timeout issue when connecting to cloud database · Issue #69 · daust/JasperReportsIntegration

When connecting to an Oracle cloud database, I see the following severe exception in the Tomcat logs: oracle.simplefan.impl.FanManager.configure attempt to configure ONS in FanManager failed with o...

github.com

 

먼가 기술과 기능은 모두 다 있고 한데 포장하는 법에 약한 우리 오라클제품 어떻게 해야 하나?

 

본 이슈의 해결책은 해당 라이브러리 중에 몇개를 제거해야 한다.

 

그 방법 중 가장 쉬운 것을 난 선택했다. (자세한 것은 위의 글에 몇가지 더 해결책이 나와 있다.)

 

  • remove ons.jar from the class path
    or
  • disable the feature through the java environment:
    java -Doracle.jdbc.fanEnabled=false ...
    
    or
  • disable the feature when establishing the connection
앞서 많은 Jar 파일을 임포트한 것 중에 ons.jar 를 제거하는 것이다.

 

그러니 바로 눈녹듯이 사르르 접속이 된다.

 

Driver Name: Oracle JDBC driver
Driver Version: 19.18.0.0.0
Default Row Prefetch Value is: 20
Database Username is: ADMIN

instance_name  version  edition  database_type
---------------------
feyk1pod2 19.0.0.0.0 EE RAC

 

구글링으로 이슈 fix 하고 한숨 돌린다.

'데이터노트 > OracleDB' 카테고리의 다른 글

Ubuntu에 OracleDB XE 11g r2 설치하기  (0) 2023.01.29

댓글