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?
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".
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)
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With