Upgrading to Oracle 19C is throwing java.lang.NoClassDefFoundError: oracle/ons/ONS" Errors

Viewed 147

I have a spring MVC application where current oracle version of my application is 1.1.0.7.0 and I have this dependency

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ons</artifactId>
    <version>11.1.0.7.0</version>
</dependency>

I need to upgrade to oracle 19c.When I looked at Maven Repository, I found that the Oracle ons artifact is moved to com.oracle.database.jdbc. When I replaced the ons dependency with the new dependency as below, I am getting java.lang.NoClassDefFoundError: oracle/ons/ONS" Errors . Below is my new dependency for oracle 19c. Pease advise.

<dependency>
    <groupId>com.oracle.database.jdbc</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>19.12.0.0</version>
</dependency>
1 Answers

As you already noticed, the artifact has been moved, together with other artifacts.

In particular, to add the ONS library to your project, you need to add this dependency:

<dependency>
   <groupId>com.oracle.database.ha</groupId>
   <artifactId>ons</artifactId>
</dependency>

Here you can find the complete documentation about how to use the new artifacts.

Related