Datafx and Netbeans 8.0.1

479 views
Skip to first unread message

Dario

unread,
Nov 5, 2014, 7:56:21 AM11/5/14
to dataf...@googlegroups.com
Hello,

I started to run write the first datafx tutorial at:


I put all the code inside a Maven template generated by NetBeans. I changed the pom files to download data flow and core. The compilation process with success.
But, when I want to run it, I get this exception:



==================================================================================================================
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:483)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303)
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:483)
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:875)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
at com.sun.javafx.application.LauncherImpl$$Lambda$49/1190900417.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.datafx.controller.flow.FlowException: org.datafx.controller.FxmlLoadException: java.lang.IllegalStateException: Location is not set.
at org.datafx.controller.flow.FlowHandler.start(FlowHandler.java:139)
at org.datafx.controller.flow.Flow.startInStage(Flow.java:293)
at com.mycompany.mymaven.MainApp.start(MainApp.java:19)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$52/35821608.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/501263526.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1164147412.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/1099983479.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: org.datafx.controller.FxmlLoadException: java.lang.IllegalStateException: Location is not set.
at org.datafx.controller.ViewFactory.createByController(ViewFactory.java:124)
at org.datafx.controller.flow.FlowHandler.start(FlowHandler.java:136)
... 12 more
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2428)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2403)
at org.datafx.controller.ViewFactory.createByController(ViewFactory.java:105)
... 13 more
Exception running application com.mycompany.mymaven.MainApp
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.424s
Finished at: Wed Nov 05 13:47:41 CET 2014
Final Memory: 19M/219M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project MyMaven: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:

======================================================================================================================



And this is the first part of pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>MyMaven</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>MyMaven</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mainClass>com.mycompany.mymaven.MainApp</mainClass>
    </properties>

    <organization>
        <!-- Used as the 'Vendor' for JNLP generation -->
        <name>Your Organisation</name>
    </organization>
    
    <dependencies>
        
        <dependency>
            <groupId>org.javafxdata</groupId>
            <artifactId>datafx-flow</artifactId>
            <version>8.0b5</version>
            <type>jar</type>
        </dependency>
        
        <dependency>
            <groupId>org.javafxdata</groupId>
            <artifactId>datafx-core</artifactId>
            <version>8.0b5</version>
            <type>jar</type>
        </dependency>
        
        
        
    </dependencies>


Any help will be appreciated.
Thx



Hendrik Ebbers

unread,
Nov 5, 2014, 10:07:30 AM11/5/14
to Dario, dataf...@googlegroups.com
Hi,

datafx can’t find your vxml file. When using maven by default any file that is not a java file must be in the src/main/resources folder. Maybe your vxml file is in the src/main/java folder?

--
You received this message because you are subscribed to the Google Groups "DataFX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datafx-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hendrik Ebbers

unread,
Nov 5, 2014, 10:24:31 AM11/5/14
to Dario, dataf...@googlegroups.com
FXML file not vxml :) that was a typo in my answer.

Dario

unread,
Nov 5, 2014, 10:50:48 AM11/5/14
to dataf...@googlegroups.com
No Problem. I got it.

Thanks a lot for helping. I checked already and the fxml is in the right place. I spent hours in dealing with this error and I don't find where it is. Check in the attachment. Here is my project, very simple, but does not run.

Hope you have another idea.
MyMaven.zip
Message has been deleted

Hendrik Ebbers

unread,
Nov 10, 2014, 1:04:29 PM11/10/14
to dataf...@googlegroups.com
Hi,
I found the problem.

Your controller class is in the package:
/src/main/java/com/mycompany/mymaven

and your FXML file is in the package
/src/main/resources/fxml

but should be in
/src/main/resources/com/mycompany/mymaven

In the FXMLController annotation you defined the FXML by "Scene.fxml" and therefore it must be in the same package as the controller. Just move the fxml file to
/src/main/resources/com/mycompany/mymaven
and everything will be fine :)

Dario

unread,
Nov 11, 2014, 3:13:46 AM11/11/14
to dataf...@googlegroups.com
Thanks a lot Hendrik for your time and help,

Yes, now it works.  

Hendrik Ebbers

unread,
Nov 12, 2014, 1:55:17 PM11/12/14
to dataf...@googlegroups.com
Perfect :)

Greg Zobel

unread,
Oct 8, 2015, 4:46:32 AM10/8/15
to DataFX
I'm so glad I found this! Thank you. I had almost given upon DataFX, but turns out the problem is it's my first time using Maven. :)
Reply all
Reply to author
Forward
0 new messages