Search code examples
javaoraclejdbcodbcoracle-xe

java.lang.NoClassDefFoundError: oracle/dms/console/DMSConsole


My OS = CentOS-7
Oracle 18.4 XE
Java 8 JDK + Tomcat 8

I facing the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: oracle/dms/console/DMSConsole
        at oracle.jdbc.driver.DMSFactory.<clinit>(DMSFactory.java:46)
        at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:1713)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:849)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:443)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:712)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at Test.main(Test.java:9)
Caused by: java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 9 more
  1. I searched a lot but was unable to find any forum where I can see aforementioned error related to oracle 18.4.0.
  2. I searched my whole server even unzipped all ojdbc*.jar but not found DMSConsole anywhere
  3. I removed all previous jdbc jar drivers and downloaded latest ojdbc8-full.tar.gz driver form this LINK but nothing fixed the problem

Best Regards


Solution

  • What are you trying to do? If you are planning to use dms jar then you should use ojdbc8dms.jar. Check out the question "What are the different JAR files on the 19.3 JDBC driver download page for?" in JDBC FAQ

    You can get these jars from maven. Check out the blog for details. You can also download these from ojdbc8-debug.tar.gz from OTN. Make sure to have dms.jar in the classpath.

     <groupId>com.oracle.database.jdbc</groupId>
     <artifactId>ojdbc8dms</artifactId>
     <version>19.6.0.0</version>
    

    enter image description here