Connector works within Intellij 'run', but not in jar

Problem while upgrading legacy application from Java-8 to 17 (modular) in Intellij with Gradle. MariaDB running in NAS. The application worked in Java-8 and in Intellij task 'run' perfectly. But in task 'jar' I get:

java.sql.SQLException: No suitable driver found for jdbc:mariadb:192.168.2.24:3306/ChainPro at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190) at com.papaworx.chainpro_m.utilities.GConnection.<init>(GConnection.java:112) at com.papaworx.chainpro_m.Main.start(Main.java:83) at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847) at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484) at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456) at javafx.graphics@19/com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:96) at javafx.graphics@19/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java) at javafx.graphics@19/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at javafx.graphics@19/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316) at java.base/java.lang.Thread.run(Thread.java:833)

running ./gradlew jpackage --scan showed no errors and completed successfully.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.