NoClassDefFoundError when using external package #53
-
Hey, Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: java/sql/SQLException "Complete" Stack TraceException in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: java/sql/SQLException at github.weichware10.toolbox.Main.lambda$changeDb$0(Main.java:193) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventFilterRecord.handleCapturingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchCapturingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchCapturingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at javafx.base/javafx.event.Event.fireEvent(Unknown Source) at javafx.graphics/javafx.scene.Node.fireEvent(Unknown Source) at javafx.controls/javafx.scene.control.Button.fire(Unknown Source) at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source) at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at javafx.base/javafx.event.Event.fireEvent(Unknown Source) at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source) at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source) at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source) at javafx.graphics/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(Unknown Source) at javafx.graphics/com.sun.glass.ui.Application.enterNestedEventLoop(Unknown Source) at javafx.graphics/com.sun.glass.ui.EventLoop.enter(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Unknown Source) at javafx.graphics/javafx.stage.Stage.showAndWait(Unknown Source) at javafx.controls/javafx.scene.control.HeavyweightDialog.showAndWait(Unknown Source) at javafx.controls/javafx.scene.control.Dialog.showAndWait(Unknown Source) at github.weichware10.toolbox.Main.changeDb(Main.java:209) at github.weichware10.toolbox.AppController.changeDb(AppController.java:53) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source) at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source) at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source) at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at javafx.base/javafx.event.Event.fireEvent(Unknown Source) at javafx.controls/javafx.scene.control.MenuItem.fire(Unknown Source) at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source) at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at javafx.base/javafx.event.Event.fireEvent(Unknown Source) at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source) at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source) at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: java.sql.SQLException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ... 111 more We have a util package: weichware10/util And this is our main app: weichware10/toolbox In my understanding, the problem is a missing transitive dependency to postgresql, but I don't know how to fix it. It could be, that this problem originates in the util package and not in the main app, but I would still like to ask for your help, since you seem quite knowledgable about this and it is difficult to find posts with similar problems on the internet. Thank you so much, your template has already helped a lot with our project - I'll be sure to check out the Sponsor button :) If you have any questions, or if I should provide anything, please let me know - I'll respond right away, since there isn't much else than this bug in my life anyways right now ;) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Try adding java.sql to the line in the pom.xml
I believe it's working in your IDE because that's defaulting to running the full JVM. When this template invokes jlink to produce a trimmed JVM it only includes the parts of the JDK you requested. Let me know if this works, and happy holidays! |
Beta Was this translation helpful? Give feedback.
Try adding java.sql to the line in the pom.xml
I believe it's working in your IDE because that's defaulting to running the full JVM. When this template invokes jlink to produce a trimmed JVM it only includes the parts of the JDK you requested.
Let me know if this works, and happy holidays!