微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

JavaFX客户端:运行Mysql连接错误无法加载资源包

如何解决JavaFX客户端:运行Mysql连接错误无法加载资源包

它在我运行 client:run 时发生。

我想要的是将 MysqL 数据库连接到我的项目。并将其交给客户。所以任何想法。怎么解决

提前致谢。

Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at java.lang.Thread.run(Thread.java:834)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB] Caused by: java.lang.ExceptionInInitializerError
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.Constants.<clinit>(Constants.java:49)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.util.Util.<clinit>(Util.java:67)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.conf.ConnectionUrl$Type.getImplementingInstance(ConnectionUrl.java:241)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.conf.ConnectionUrl$Type.getConnectionUrlInstance(ConnectionUrl.java:211)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.conf.ConnectionUrl.getConnectionUrlInstance(ConnectionUrl.java:280)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:195)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at java.sql.DriverManager.getConnection(DriverManager.java:677)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at java.sql.DriverManager.getConnection(DriverManager.java:228)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at org.quiz.service.MysqL.authorize(MysqL.java:11)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at org.quiz.App.start(App.java:34)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at java.security.AccessController.doPrivileged(AccessController.java:102)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.glass.ui.invokelaterdispatcher$Future.run(invokelaterdispatcher.java:96)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_lang_Runnable_2_0002erun_00028_00029V(JNIJavaCallWrappers.java:0)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      ... 3 more
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB] Caused by: java.lang.RuntimeException: Can't load resource bundle due to underlying exception java.util.MissingResourceException: Resource bundle not found com.MysqL.cj.LocalizedErrorMessages. Register the resource bundle using the option -H:IncludeResourceBundles=com.MysqL.cj.LocalizedErrorMessages.
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.Messages.<clinit>(Messages.java:60)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      ... 26 more
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB] Caused by: java.util.MissingResourceException: Resource bundle not found com.MysqL.cj.LocalizedErrorMessages. Register the resource bundle using the option -H:IncludeResourceBundles=com.MysqL.cj.LocalizedErrorMessages.
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.oracle.svm.core.jdk.LocalizationSupport.getCached(LocalizationSupport.java:66)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at java.util.ResourceBundle.getBundle(ResourceBundle.java:56)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      at com.MysqL.cj.Messages.<clinit>(Messages.java:58)
[Fri Apr 09 15:52:10 PKT 2021][INFO] [SUB]      ... 28 more

我猜他们说要添加这个 -H:IncludeResourceBundles=com.MysqL.cj.LocalizedErrorMessages。我不知道在哪里添加它。我正在使用 Maven。 javafx 项目。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。