Exception in thread «JavaFX Application Thread» java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
Пробую разбираться с javaFX.Выбрасывает вот таки ошибки.
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1787) at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1670) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.controls/javafx.scene.control.MenuItem.fire(MenuItem.java:465) at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1380) at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1333) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3876) at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604) at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874) at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433) at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556) at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175) at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76) at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:275) at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83) at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1784) . 43 more Caused by: java.lang.IllegalStateException: Location is not set. at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2459) at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435) at gui.application.manager.main.MainManagerController.createOrder(MainManagerController.java:120) . 54 more
package runner; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application < private static Stage window; public static Stage getMainStage() < return window; >public static void setMainStage(Stage window) < Main.window = window; >@Override public void start(Stage primaryStage) throws Exception < window = primaryStage; Parent root = FXMLLoader.load(getClass().getResource("../gui/authorization/authorization.fxml")); window.setTitle("Авторизация"); window.setScene(new Scene(root, 466, 300)); window.show(); >public static void main(String[] args) < launch(); >>
package server; import client.Client; import gui.application.manager.main.MainManagerController; import gui.application.mechanic.main.MainMechanicController; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.stage.Stage; import runner.Main; import java.io.IOException; public class LoggingInstructions < public void executeAuthInstructions(String serverAnswer) < String[] command = serverAnswer.split("/"); switch (command[0]) < case "Ошибка Авторизации": Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle(command[0]); alert.setHeaderText(null); alert.setContentText("Неправильный логин иили пароль"); alert.showAndWait(); break; case "механик": try < Parent root; MainMechanicController mainMechanicController; FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("../gui/application/mechanic/mainMechanic.fxml")); root = loader.load(); Main.getMainStage().setScene((new Scene(root, 900, 700))); mainMechanicController = loader.getController(); mainMechanicController.init("Механик: " + command[2],"ID Механика: "+command[1]); >catch (IOException ex) < ex.printStackTrace(); >break; case "менеджер": try < FXMLLoader loader = new FXMLLoader(); Parent root; MainManagerController mainManagerController; loader.setLocation(getClass().getResource("../gui/application/manager/main/mainManager.fxml")); root = loader.load(); Main.getMainStage().setScene((new Scene(root, 900, 700))); mainManagerController = loader.getController(); mainManagerController.init("Менеджер: " + command[2],"ID Менеджера: " + command[1]); >catch (IOException ex) < ex.printStackTrace(); >break; > if(!command[0].equals("Ошибка Авторизации")) < Client client=Client.getInstance(); StringBuilder sb=new StringBuilder(); for (int i = 1; i < command.length; i++) < sb.append(command[i]+"/"); >sb.deleteCharAt(sb.length()-1); client.setClientInfo(sb.toString()); > > >
package gui.application.manager.main; import entity.Car; import entity.Purchase; import gui.application.manager.order.OrderController; import gui.application.mechanic.main.MainMechanicController; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.stage.Stage; import runner.Main; import server.CommandsExecuter; import java.io.File; import java.io.IOException; public class MainManagerController < private CommandsExecuter commandsExecuter; @FXML private Label managerLabel; @FXML private ImageView managerImage; @FXML private Label managerID; @FXML private TableViewcarTable; @FXML private TableColumn carCode; @FXML private TableColumn carBrand; @FXML private TableColumn carModel; @FXML private TableColumn carYear; @FXML private TableColumn carEngineType; @FXML private TableColumn carEngineCapacity; @FXML private TableColumn carColor; @FXML private TableColumn carPrice; @FXML private TableView orderTable; @FXML private TableColumn purchaseNumber; @FXML private TableColumn carID; @FXML private TableColumn clientID; @FXML private TableColumn employeeID; @FXML private TableColumn purchaseDate; public void init(String manager, String userID) < commandsExecuter = new CommandsExecuter(); managerLabel.setText(manager); Image image = new Image(new File("images/manager.jpg").toURI().toString()); managerImage.setImage(image); managerID.setText(userID); /*MenuItem mi1 = new MenuItem("Создать заказ с выбранным автомобилем"); mi1.setOnAction((ActionEvent event) ->< Car item = carTable.getSelectionModel().getSelectedItem(); >); ContextMenu menu = new ContextMenu(); menu.getItems().add(mi1);* carTable.setContextMenu(menu);*/ > @FXML private void getCarList() < ObservableListcarList = FXCollections.observableArrayList( commandsExecuter.getCarList()); carCode.setCellValueFactory(new PropertyValueFactory<>("carID")); carBrand.setCellValueFactory(new PropertyValueFactory<>("brand")); carModel.setCellValueFactory(new PropertyValueFactory<>("model")); carYear.setCellValueFactory(new PropertyValueFactory<>("year")); carEngineType.setCellValueFactory(new PropertyValueFactory<>("engineType")); carEngineCapacity.setCellValueFactory(new PropertyValueFactory<>("engineCapacity")); carColor.setCellValueFactory(new PropertyValueFactory<>("color")); carPrice.setCellValueFactory(new PropertyValueFactory<>("price")); carTable.setItems(carList); > @FXML private void getOrderList() < ObservableListpurchaseList=FXCollections.observableArrayList(commandsExecuter.getPurchaseList()); purchaseNumber.setCellValueFactory(new PropertyValueFactory<>("purchaseID")); carID.setCellValueFactory(new PropertyValueFactory<>("carID")); clientID.setCellValueFactory(new PropertyValueFactory<>("clientID")); employeeID.setCellValueFactory(new PropertyValueFactory<>("employeeID")); purchaseDate.setCellValueFactory(new PropertyValueFactory<>("date")); orderTable.setItems(purchaseList); > @FXML private void closeApp() < Platform.exit(); >@FXML private void createOrder() < Parent root; try < FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("../gui/application/manager/order/order.fxml")); Stage orderStage = new Stage(); root = loader.load(); orderStage.setScene(new Scene(root, 700, 400)); >catch (IOException e) < e.printStackTrace(); >> >
Не могу понять почему вылетает это ошибка и не запускается новое окно.Помогите
Minecraft Forums
Exception in thread «main» java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
i want to start server with these mods, this is 1.17.1 version and i can’t, i don’t know what is going on
- Farlander
- Join Date: 9/20/2016
- Posts: 18,538
- Location: Germany
- Member Details
Remove the client-side-mods from your server:
So remove these from your server’s mods-folder, keep these in your client
If it is crashing again, add the new log — maybe there are some more client mods
space
Crash Report UUID: d3568d59-9557-4655-9e11-c478d62560d3
FML: 37.1
Forge: net.minecraftforge:37.1.1[21:32:41] [main/FATAL]: Failed to start the minecraft server
net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
Minecraft Dungeons (duneons) has failed to load correctly
ž7java.lang.ExceptionInInitializerError: null
]
at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:236) ~[fmlcore-1.17.1-37.1.1.jar%2366. ]
at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$21(ModLoader.java:201) ~[fmlcore-1.17.1-37.1.1.jar%2366. ]
at java.util.Optional.ifPresent(Optional.java:178) ~[. ]
at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:201) ~[fmlcore-1.17.1-37.1.1.jar%2366. ]
at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$11(ModLoader.java:178) ~[fmlcore-1.17.1-37.1.1.jar%2366. ]
at java.lang.Iterable.forEach(Iterable.java:75) ~[. ]
at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:178) ~[fmlcore-1.17.1-37.1.1.jar%2366. ]
at net.minecraftforge.fmllegacy.server.ServerModLoader.load(ServerModLoader.java:45) ~[forge-1.17.1-37.1.1-universal.jar%2369. ]
at net.minecraft.server.Main.main(Main.java:100) ~[server-1.17.1-20210706.113038-srg.jar%2365. ]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[. ]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[. ]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[. ]
at java.lang.reflect.Method.invoke(Method.java:568) ~[. ]
at net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:46) ~[fmlloader-1.17.1-37.1.1.jar%2323. ]
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235. ]
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?]
C:\Serverek>pause
Press any key to continue . . .