使用 Flyway 时出现 NoClassDefFoundError
NoClassDefFoundError when using Flyway
以下调用(我用 <> 替换了敏感信息):
flyway
-url=jdbc:oracle:thin:@//<server_name>:<port_number>/<service_name>
-jarDirs=<jar_directory_paths>
-locations=filesystem:<path>
-user=<user> -password=<password> info
产生以下错误:
Flyway output: Flyway 4.2.0 by Boxfuse
Exception in thread "main" java.lang.NoClassDefFoundError:
oracle/dms/console/DMSConsole
at oracle.jdbc.driver.DMSFactory.(DMSFactory.java:44)
at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:4202)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:628)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:217)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:28)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:537)
at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:416)
at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(DriverDataSource.java:381)
at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51)
at org.flywaydb.core.Flyway.execute(Flyway.java:1418)
at org.flywaydb.core.Flyway.info(Flyway.java:1097)
at org.flywaydb.commandline.Main.executeOperation(Main.java:152)
at org.flywaydb.commandline.Main.main(Main.java:103) Caused by: java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
任何想法可能是什么原因?
异常消息中缺少的class在v8 Oracle JDBC驱动程序和后续驱动程序中。您应该能够通过将安装升级到最新版本的驱动程序来解决问题。
以下调用(我用 <> 替换了敏感信息):
flyway
-url=jdbc:oracle:thin:@//<server_name>:<port_number>/<service_name>
-jarDirs=<jar_directory_paths>
-locations=filesystem:<path>
-user=<user> -password=<password> info
产生以下错误:
Flyway output: Flyway 4.2.0 by Boxfuse
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/dms/console/DMSConsole at oracle.jdbc.driver.DMSFactory.(DMSFactory.java:44) at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:4202) at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:628) at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:217) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:28) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:537) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:416) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(DriverDataSource.java:381) at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51) at org.flywaydb.core.Flyway.execute(Flyway.java:1418) at org.flywaydb.core.Flyway.info(Flyway.java:1097) at org.flywaydb.commandline.Main.executeOperation(Main.java:152) at org.flywaydb.commandline.Main.main(Main.java:103) Caused by: java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 13 more
任何想法可能是什么原因?
异常消息中缺少的class在v8 Oracle JDBC驱动程序和后续驱动程序中。您应该能够通过将安装升级到最新版本的驱动程序来解决问题。