使用Flyway时出现NoClassDefFoundError

时间:2019-06-26 14:08:37

标签: java noclassdeffounderror 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输出:Boxfuse的Flyway 4.2.0

     

线程“主”中的异常java.lang.NoClassDefFoundError:   oracle / dms / console / DMSConsole       在oracle.jdbc.driver.DMSFactory。(DMSFactory.java:44)       在oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:4202)       在oracle.jdbc.driver.PhysicalConnection。(PhysicalConnection.java:628)       在oracle.jdbc.driver.T4CConnection。(T4CConnection.java:217)       在oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:28)       在oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:537)       在org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:416)       在org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(DriverDataSource.java:381)       在org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51)       在org.flywaydb.core.Flyway.execute(Flyway.java:1418)       在org.flywaydb.core.Flyway.info(Flyway.java:1097)       在org.flywaydb.commandline.Main.executeOperation(Main.java:152)       在org.flywaydb.commandline.Main.main(Main.java:103)上由:java.lang.ClassNotFoundException:oracle.dms.console.DMSConsole       在java.net.URLClassLoader.findClass(URLClassLoader.java:382)       在java.lang.ClassLoader.loadClass(ClassLoader.java:424)       在sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:349)       在java.lang.ClassLoader.loadClass(ClassLoader.java:357)       ...还有13个

任何想法可能是什么原因?

1 个答案:

答案 0 :(得分:1)

异常消息中缺少的类在v8 Oracle JDBC驱动程序及其后续驱动程序中。通过将安装升级到最新版本的驱动程序,您应该能够解决该问题。