Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot app error log says attempt to configure ONS in FanManager failed with oracle.ons.NoServersAvailable

I am running a Spring Boot application (v2.2.0-RELEASE) with spring-boot-starter-jdbc and com.oracle.ojdbc:ojdbc8:19.3.0.0 driver.

When I try to query the database using JdbcTemplate I see the following error in the console log:

2019-11-15 14:07:51.154 ERROR 23436 --- [main] oracle.simplefan.FanManager: attempt to configure ONS in FanManager failed with oracle.ons.NoServersAvailable: Subscription time out

I have no clue why I'm seeing this error even though the database connection is successful and query result is correct.

Is there any way to get rid of this error or just ignore?

like image 554
Saikat Avatar asked Nov 15 '19 08:11

Saikat


2 Answers

You can set the system property when starting the application:

-Doracle.jdbc.fanEnabled=false

Or remove the simplefan and ons jars from the classpath. With Maven it might look like this:

<dependency>
  <groupId>com.oracle.database.jdbc</groupId>
  <artifactId>ojdbc10</artifactId>
  <version>${oracle.version}</version>
  <exclusions>
    <exclusion>
      <groupId>com.oracle.database.ha</groupId>
      <artifactId>simplefan</artifactId>
    </exclusion>
    <exclusion>
      <groupId>com.oracle.database.ha</groupId>
      <artifactId>ons</artifactId>
    </exclusion>
  </exclusions>
</dependency>

More details in Section 29.3 of the Oracle's JDBC Developer's guide "Installation and Configuration of Oracle JDBC Driver for FAN Events Support".

like image 60
Antoni Myłka Avatar answered Nov 06 '22 12:11

Antoni Myłka


For removing the jars with maven Antoni's answer might not work for you if the group id for the jars is not identical (different ojdbc version for example). You need to find these group ids. For example I use ojdbc8, looking at the used libraries in my IDE (Idea here) I can see the groupId of ons and simplefan (here com.oracle.jdbc)

Using the IDE to find the groupId of libraries

Now I only need to put the appropriate Ids for exclusion (here the example is for ojdbc 8)

<dependency>
  <groupId>com.oracle.ojdbc</groupId>
  <artifactId>ojdbc8</artifactId>
  <exclusions>
    <exclusion>
      <groupId>com.oracle.ojdbc</groupId>
      <artifactId>simplefan</artifactId>
    </exclusion>
    <exclusion>
      <groupId>com.oracle.ojdbc</groupId>
      <artifactId>ons</artifactId>
    </exclusion>
  </exclusions>
</dependency>
like image 1
user2588770 Avatar answered Nov 06 '22 11:11

user2588770