Error while trying to run Scene

Asked

Viewed 95 times

1

I made a screen with Scene Builder, but when I compile in Javafx gives this error could help me?

    ant -f C:\\Users\\gusta\\Desktop\\TccProject\\LoginJAVAFXML jfxsa-run
init:
Deleting: C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\built-jar.properties
Copying 1 file to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\classes
compile:
Deleting directory C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\lib
Copying 1 file to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\lib
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from C:\Program Files\Java\jdk1.8.0_172\jre\..\lib\ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
         Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.8.0_172\jre\..\lib\ant-javafx.jar
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
jfx-deployment-script:
jfx-deployment:
jar:
Copying 13 files to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770
jfx-project-run:
Executing C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770\LoginJAVAFXML.jar using platform C:\Program Files\Java\jdk1.8.0_172\jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: Location is required.
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3207)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    at loginjavafxml.LoginJAVAFXML.start(LoginJAVAFXML.java:23)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    ... 1 more
Exception running application loginjavafxml.LoginJAVAFXML
Java Result: 1
Deleting directory C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770
jfxsa-run:
CONSTRUÍDO COM SUCESSO (tempo total: 5 segundos)

1 answer

1


Check in your Scenebuilder if you are referencing your Controller class. Can be edited directly in FXML this way

fx:controller="sample.Controller"
  • Sim no meu FXML tem no codigo :&#xA;&#xA;<AnchorPane id="AnchorPane" prefHeight="500.0" prefWidth="800.0" style="-fx-background-color: #010A0A;" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="loginjavafxml.FXMLDocumentController">

  • I noticed in the error it displaying "In JDK. Package base will use system JRE.", you did the installation of your JDK? ran other projects on this machine?

  • Yes I use JDK version 1.8 I am using a JAR library also called Jfoenix https://github.com/jfoenixadmin/JFoenix including downloaded pro JDK8, yes I did other projects already but I even ran that xml standard when Voce creates a JFXML project

  • Dude I have an example of a project of mine if you want to take a look https://github.com/Phomint/Odonware, because I think it’s a problem in the Controller.

  • I will see yes! Thank you so much for helping!

  • Our you saved me was in the same controler was a beast thing

  • here : Parent root = Fxmlloader.load(getClass(). getResource("Fxmllogin.fxml"));

  • was another name so the BUG instead of Fxmllogin.fxml had something else there

  • Sure glad it worked out vlw

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.