• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Security and javafx.fxml.FXMLLoader.loadImpl(Unknown Source) javafx, netbeans

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, Everyone! I lost my temper with the issue.
The problem is I cannot start my JavaFX FXML Application in WebBrowser. I use NetBeans 8.1 as IDE, Windows 8 64-bit and jdk1.8.0_65. So, if I create a new JavaFX Application - it works. It works as a desctop and it works when I start it inside the WebBrowser. But if I create new JavaFX FXML Application it won't work. It works as a desctop application perfectly, but when I tried to start *.jnlp or in WebBrowser I got this:

Missing Application-Name manifest attribute for: file:/C:/Users/Sergey.Lotvin/Documents/NetBeansProjects/JavaFXApplication5/dist/JavaFXApplication5.jar
java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafxapplication5.JavaFXApplication5.start(JavaFXApplication5.java:22)



What I did:

1. New Project > JavaFX FXML Application
2. Run to check if it works. So, button "Click Me" on the place, click and label "Hello World!" appeared.
3. Then go to project properties>Run>Run in Browser
4. Start Java Config and add file:///C:/... to exception list
5. I even signed my JavaFX FXML Application using

For sure I've created .keystore before etc. So I got message in cmd like - jar signed.

6. I got picture


7. but then picture



The problem is I cannot start my JavaFX FXML Application in WebBrowser. I use NetBeans 8.1 as IDE, Windows 8 64-bit and jdk1.8.0_65. So, if I create a new JavaFX Application - it works. It works as a desctop and it works when I start it inside the WebBrowser. But if I create new JavaFX FXML Application it won't work. It works as a desctop application perfectly, but when I tried to start *.jnlp or in WebBrowser I got this:

> Missing Application-Name manifest attribute for: file:/C:/Users/Sergey.Lotvin/Documents/NetBeansProjects/JavaFXApplication5/dist/JavaFXApplication5.jar
java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at javafxapplication5.JavaFXApplication5.start(JavaFXApplication5.java:22)
What I did:

New Project > JavaFX FXML Application
Run to check if it works. So, button "Click Me" on the place, click and label "Hello World!" appeared.
Then go to project properties>Run>Run in Browser
Start Java Config and add file:///C:/... to exception list
I even signed my JavaFX FXML Application using
keytool -genkey -keystore .keystore -alias «Terrasoft» -validity 99999 jarsigner.exe -keystore .keystore myJavaFXFXMLApplication.jar «Terrasoft» For sure I've created .keystore before etc. So I got message in cmd like - jar signed.

I got picture enter image description here
but then picture enter image description here
I've changed
Parent root =FXMLLoader.load(getClass().getResource("FXMLMain.fxml")); in different way without success.

jar structure


Questions:

How to force it to work?
Why do one need all this difficults with certifications?
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a heads-up that it is a good idea to post a reference to a cross-post when you post on JavaRanch (it's just a site policy):
https://coderanch.com/t/660346/Wiki/Forthright-Cross-Posting-Sites
http://stackoverflow.com/questions/37196696/java-security-and-javafx-fxml-fxmlloader-loadimplunknown-source-javafx
 
Sergey Lotvin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I'll take it.
Regarding the subject. Neither here nor here I got any information. But I found out that this technology - RIA and when user download some software and this software run on client machine - is kinda obsolete. Microsoft provided Silverlight, but now Silverlight looks like a doomed and forgotten branch of evolution. The same with Flash, and the same with JavaFX. So JavaFX now is more for desktop. Also, for example, Google Chrome doesn't support NPAPI which is needed for RIA things. It is like another sign of dying RIA based on SL, Flash, JavaFX.
Instead - HTML5. And if one need web application it's better to go with J2EE (jsp/servlets...).
Am I right in my reasoning?
 
John Damien Smith
Rancher
Posts: 387
30
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Am I right in my reasoning?

In general, yes, that is a very good summary of the state of things.
There may still be niche applications where browser plugin based tech such as Flash or JavaFX may be a preferred technology, but for the majority of applications and websites, this will not be the case.
Technologies such as JavaFX are usually more applicable to desktop, mobile or embedded device use cases, then embedding inside a browser based HTML web application.

> And if one need web application it's better to go with J2EE (jsp/servlets...).

There is a vast array of technology for web applications and the "better" technologies to choose would depend on a wide array of factors, such as familiarity with a given technology, the nature of the application being developed and the organization culture at hand, etc. JSPs are largely obsoleted by newer technology such as JSF and servlets are still there but are a bit more of a low-level implementation technology now, with a lot of use cases programming to higher level APIs such as JAX-RS, sometimes generated by things like swagger http://swagger.io. For Java technologies, Spring (especially in its more recent Spring Boot iteration) http://projects.spring.io/spring-boot/ is a reasonable alternative that many organizations employ rather than a full JEE stack such as WildFly, http://wildfly-swarm.io, though, really, both tools are valid and will get the vast majority of jobs done for this type of work. And, of course, there are plenty of non-Java based options such as node.js, django, rails etc. For front-end technology for web applications, a lot of companies are going with JavaScript based frameworks such as Angular, etc. Though do be careful that a lot of JavaScript frameworks end up going through a "flavor of the month" phase.
 
Sergey Lotvin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whoa! Gotcha, Isee a lot of work in future to study all that stuff. Well, a couple of more questions, if you please:
1. Are there the same situation for the guys who are studying C# and all .NET stuff? Are there also so many frameworks, tech-s... so much information to know?
2. Could you please advise what to study next after Eckel (Thinking In Java) and jsp/servlets/EL/jstl? Yeah, I know I have to sharp my mind to do much more practices etc., but, you know, juat the direction. Maybe the most popular or the most necessary...hope you understand my inarticulation.

For instance, what shall I study in order to realize at least smth like this ->


Thanks in advance
 
John Damien Smith
Rancher
Posts: 387
30
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 1. Are there the same situation for the guys who are studying C# and all .NET stuff?

There are some issues that those techs have that are common to issues in Java, there are some issues that are specific to Java and there are some issues that those technologies have that Java does not have.

> Are there also so many frameworks, tech-s... so much information to know?

Yes. But the key is that you don't need to learn and know everything. Work out what you want to do, what interests you, what your environment constrains you to use, then based upon that pick as appropriate set of technologies you need to know to get the work done and go do it. Don't even worry about if you picked the best technology or the wrong technology, and if things don't seem to be working out with one technology be prepared to switch if needed. For example, don't try to learn both JEE and Sprint or JavaFX and Swing or Angular and JSF, choose one or the other from each of those choices.

If you are not really sure what you like or how to evaluate stuff and just want to understand what different technologies can do, then you can take a crash course in a variety without going into too much depth in a particular technology, that way you have a better feel for things to have more confidence in your decisions: https://pragprog.com/book/btlang/seven-languages-in-seven-weeks. Be aware that if you take an evaluation approach like 7 languages in 7 weeks, you are not really learning those languages, you are just being exposed to the ideas in them so you can see what you like, to truly learn any of them in depth takes quite some time. The same is true of anything else in computer science that you wish to evaluate or learn.
 
Sergey Lotvin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. What if I want to create beautiful GUI? Does framework help somehow or it's only just up to HTML5+CSS?
 
John Damien Smith
Rancher
Posts: 387
30
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> What if I want to create beautiful GUI? Does framework help somehow or it's only just up to HTML5+CSS?

If you want to create a beautiful GUI, then invest time in developing nice artwork, fonts, pleasing layouts, etc.
Perhaps hire or subcontract a designer if you don't have a lot of design skills yourself.
You can create beautiful GUIs in both JavaFX and HTML+CSS.
If working with an external designer, it is unlikely that they would be familiar with JavaFX, but likely they would be familiar with HTML+CSS.
If it is just yourself and you are already working with and know JavaFX, then you can probably more easily create a nice GUI using tools such as scene builder and the JavaFX CSS system.
If your target is a web based application, then HTML+CSS is more appropriate.
If your target is a desktop application or a mobile application, then JavaFX is likely a reasonable choice.
It takes effort and work to make beautiful stuff, so be prepared for that.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem and could solve it. My answer is here https://stackoverflow.com/questions/31279442/javafx-nullpointerexception-location-is-required-netbeans/46844099#46844099 . In netbeans 8.2 in the project properties under Build > Deployment there is a check-box "Request unrestricted access (Enable signing)".
reply
    Bookmark Topic Watch Topic
  • New Topic