Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FXML JavaFX app run through JNLP java.lang.NullPointerException: Location is required

 
Petr Omáčka
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Crossposted:
http://stackoverflow.com/questions/37485210/fxml-javafx-app-run-through-jnlp-java-lang-nullpointerexception-location-is-req
https://community.oracle.com/message/13857396#13857396

I try to deploy JavaFX FXML app as Web Start but I have got exception bellow. Jar is normaly working and also works deployed as self-contained app. I have build project in NetBeans v. 8.0.2. I have found so many similar threads over internet but either solution works nor I was thinking that solution is the right one.

In all solution has been identified this row

SomeClass root = FXMLLoader.load(getClass().getResource("someFXML.fxml"));

as a cause.

Solutions was:

1. Use path /someFXML.fxml.
2. Use FXMLLoader.load(getClass().getClassLoader().getResource("someFXML.fxml"));
3. Use FXMLLoader.load(getClass().getClassLoader().getResource("packageName/someFXML.fxml"));
4. Checks for files presence.
5. Signing the jar.

I have tried perhaps all of them.

I am thinking that the solution not depends on row shown.

Exception



Main Class



Controller



FXML

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic