Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28364 > unrolled thread

JavaFX beginner issue

Started byRhino <no_offline_contact_please@example.com>
First post2014-05-04 23:25 -0400
Last post2014-05-06 17:02 -0400
Articles 6 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  JavaFX beginner issue Rhino <no_offline_contact_please@example.com> - 2014-05-04 23:25 -0400
    Re: JavaFX beginner issue Wayne <nospam@all.invalid> - 2014-05-05 01:53 -0400
      Re: JavaFX beginner issue Rhino <no_offline_contact_please@example.com> - 2014-05-05 11:29 -0400
        Re: JavaFX beginner issue Jeff Higgins <jeff@invalid.invalid> - 2014-05-05 12:13 -0400
        Re: JavaFX beginner issue Wayne <nospam@all.invalid> - 2014-05-05 23:41 -0400
          Re: JavaFX beginner issue Rhino <no_offline_contact_please@example.com> - 2014-05-06 17:02 -0400

#28364 — JavaFX beginner issue

FromRhino <no_offline_contact_please@example.com>
Date2014-05-04 23:25 -0400
SubjectJavaFX beginner issue
Message-ID<lk70ap$cv0$1@dont-email.me>
I'm dabbling with JavaFX in NetBeans 8.0 and am trying to run a jar as a 
Java Web Start application.  When I double-click on the HTML file 
created by NetBeans, I get:
======================================================================
Application Blocked by Security Settings

Name: fxswingtest01.FxSwingTest01
Location: file://
Your security settings have blocked a self-signed application from running
=======================================================================

What do I need to do to resolve this situation? I assume I need to give 
Java permission to run this application but I'm not sure how or where to 
do it and the tutorial I'm using didn't think to include this 
information....

-- 
Rhino

[toc] | [next] | [standalone]


#28366

FromWayne <nospam@all.invalid>
Date2014-05-05 01:53 -0400
Message-ID<lHF9v.138374$1j7.5697@fx01.iad>
In reply to#28364
On 5/4/2014 11:25 PM, Rhino wrote:
> I'm dabbling with JavaFX in NetBeans 8.0 and am trying to run a jar as a Java Web
> Start application.  When I double-click on the HTML file created by NetBeans, I get:
> ======================================================================
> Application Blocked by Security Settings
> 
> Name: fxswingtest01.FxSwingTest01
> Location: file://
> Your security settings have blocked a self-signed application from running
> =======================================================================
> 
> What do I need to do to resolve this situation? I assume I need to give Java
> permission to run this application but I'm not sure how or where to do it and the
> tutorial I'm using didn't think to include this information....
> 

You can set the security level to its lowest setting of "medium"
in the Java control panel.  Or, also from the control panel,
you can white-list various locations such as "http://localhost/",
"https://localhost/", and "file:///".  (You will get warning when
adding http or file protocol URLs, but you can ignore those for
localhost.)

Or you can obtain a signing certificate and sign your code.

-- 
Wayne

[toc] | [prev] | [next] | [standalone]


#28373

FromRhino <no_offline_contact_please@example.com>
Date2014-05-05 11:29 -0400
Message-ID<lk8aom$g3i$1@dont-email.me>
In reply to#28366
On 2014-05-05 1:53 AM, Wayne wrote:
> On 5/4/2014 11:25 PM, Rhino wrote:
>> I'm dabbling with JavaFX in NetBeans 8.0 and am trying to run a jar as a Java Web
>> Start application.  When I double-click on the HTML file created by NetBeans, I get:
>> ======================================================================
>> Application Blocked by Security Settings
>>
>> Name: fxswingtest01.FxSwingTest01
>> Location: file://
>> Your security settings have blocked a self-signed application from running
>> =======================================================================
>>
>> What do I need to do to resolve this situation? I assume I need to give Java
>> permission to run this application but I'm not sure how or where to do it and the
>> tutorial I'm using didn't think to include this information....
>>
>
> You can set the security level to its lowest setting of "medium"
> in the Java control panel.  Or, also from the control panel,
> you can white-list various locations such as "http://localhost/",
> "https://localhost/", and "file:///".  (You will get warning when
> adding http or file protocol URLs, but you can ignore those for
> localhost.)
>
> Or you can obtain a signing certificate and sign your code.
>

Thanks Wayne, I think we're heading in the right direction but I need 
some more detail....

I've tried adding all of these entries to the white-list in the Security 
tab of the Java Control Panel:

http://localhost/
https://localhost/
http://127.0.0.1/
https:/127.0.0.1/
file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.html
file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.jnlp

I'm running Windows 8.1. When I double-click on the HelloWorld.jar in 
File Explorer here on the laptop, the application launches just fine. 
When I right-click on the HTML file and open it in Firefox, the Test 
Page for HelloWorld shows a "loading" animation that just keeps spinning 
and spinning and spinning but never gets done.

When I right-click on the JNLP file in File Explorer, I get the Web 
Start "Java ..." splash screen, then I'm back to the error message I 
reported in my initial post in this thread.

Hmm. I just added the following to the white-list:

file://

Now, when I right-click on the JNLP file and choose Open With Java Web 
Start Launcher, it actually launches without the error message! However, 
right-clicking on the HTML file and opening it in Firefox works no 
better than it did before.

Just for the heck of it, I uploaded the whole dist folder to a remote 
server and tried to access the HTML page: I get the same error as I do 
on my local hard drive in File Explorer. When I tried to open the JNLP 
file on the remote server, the browser asked me which application I 
wanted to use and I chose Java Web Start Launcher and got this:

=====================================================================
Application Error
General Exception
Name: helloworld.HelloWorld
ExitException[3]com.sun.deploy.net.FailedDownloadException:
Unable to load resource:
file:/C/Users/RHINO_~1/AppData/Local/Temp/HelloWorld.jar
	at sun.plugin2.applet.JNLP2Manager.downloadResources(Unknown Source)
	at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
	at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
	at 
sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown 
Source)
	at java.lang.Thread.run(Unknown Source)
==========================================================================

Why is it looking for a resource on my hard drive when I'm running it on 
a remote server? How do I fix this?


-- 
Rhino

[toc] | [prev] | [next] | [standalone]


#28375

FromJeff Higgins <jeff@invalid.invalid>
Date2014-05-05 12:13 -0400
Message-ID<lk8dfg$768$1@dont-email.me>
In reply to#28373
On 05/05/2014 11:29 AM, Rhino wrote:
> Thanks Wayne, I think we're heading in the right direction but I need
> some more detail....

Not a direct answer to your question, but:
<http://docs.oracle.com/javase/8/docs/technotes/guides/jweb/>

[toc] | [prev] | [next] | [standalone]


#28385

FromWayne <nospam@all.invalid>
Date2014-05-05 23:41 -0400
Message-ID<HRY9v.5$pP1.4@fx07.iad>
In reply to#28373
On 5/5/2014 11:29 AM, Rhino wrote:
> On 2014-05-05 1:53 AM, Wayne wrote:
>>> Application Blocked by Security Settings
>>>
>>> Name: fxswingtest01.FxSwingTest01
>>> Location: file://
>>> Your security settings have blocked a self-signed application from running
>>> =======================================================================
>>>
>>> What do I need to do to resolve this situation? I assume I need to give Java
>>> permission to run this application but I'm not sure how or where to do it and the
>>> tutorial I'm using didn't think to include this information....
>>>
>>
>> You can set the security level to its lowest setting of "medium"
>> in the Java control panel.  Or, also from the control panel,
>> you can white-list various locations such as "http://localhost/",
>> "https://localhost/", and "file:///".  (You will get warning when
>> adding http or file protocol URLs, but you can ignore those for
>> localhost.)
>>
>> Or you can obtain a signing certificate and sign your code.
>>
> 
> Thanks Wayne, I think we're heading in the right direction but I need some more
> detail....
> 
> I've tried adding all of these entries to the white-list in the Security tab of the
> Java Control Panel:
> 
> http://localhost/
> https://localhost/
> http://127.0.0.1/
> https:/127.0.0.1/
> file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.html
> file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.jnlp
> 

Those last two URLs are illegal, so I doubt they'd help.

> I'm running Windows 8.1. When I double-click on the HelloWorld.jar in File Explorer
> here on the laptop, the application launches just fine. When I right-click on the
> HTML file and open it in Firefox, the Test Page for HelloWorld shows a "loading"
> animation that just keeps spinning and spinning and spinning but never gets done.
> 
> When I right-click on the JNLP file in File Explorer, I get the Web Start "Java ..."
> splash screen, then I'm back to the error message I reported in my initial post in
> this thread.
> 
> Hmm. I just added the following to the white-list:
> 
> file://

Try it with three slashes.  Hierarchical URI protocols always end in "://"
(while non-hierarchical ones end in ":").  So that URI doesn't specify
any particular host/codebase.  A third slash conventionally means localhost.

> 
> Now, when I right-click on the JNLP file and choose Open With Java Web Start
> Launcher, it actually launches without the error message! However, right-clicking on
> the HTML file and opening it in Firefox works no better than it did before.

Web browsers often have difficulty with that.  It has something to do with
a confusion by the web browser if the resource is local or remote.  Different
internal URIs are used.  I just run a local webserver, put my files in that,
and use http://localhost/ to test 'em out.  This avoids using file:// protocols.

You can see if that's the problem by (temporarily) setting the security
level to medium, and see if the problem goes away.  If so, you just need to
get the URIs in the white list correct.

Note, Java DOES NOT (yet) support IPv6 for specifying security parameters such
as this white-list.  (I've asked.)  Since all hosts default to IPv6 first, then
fall back on IPv4, you may see your browser using "localhost", but Java won't
notice that if IPv6 to localhost is tried (by the browser).  In that case
the IP address used to launch your Java app is "::1", not "localhost" or
"127.0.0.1", and that will fail.  You can try to always use the
"127.0.0.1 value in your URIs, that may also solve your issue.

-- 
Wayne

[toc] | [prev] | [next] | [standalone]


#28407

FromRhino <no_offline_contact_please@example.com>
Date2014-05-06 17:02 -0400
Message-ID<lkbijv$clu$1@dont-email.me>
In reply to#28385
On 2014-05-05 11:41 PM, Wayne wrote:
> On 5/5/2014 11:29 AM, Rhino wrote:
>> On 2014-05-05 1:53 AM, Wayne wrote:
>>>> Application Blocked by Security Settings
>>>>
>>>> Name: fxswingtest01.FxSwingTest01
>>>> Location: file://
>>>> Your security settings have blocked a self-signed application from running
>>>> =======================================================================
>>>>
>>>> What do I need to do to resolve this situation? I assume I need to give Java
>>>> permission to run this application but I'm not sure how or where to do it and the
>>>> tutorial I'm using didn't think to include this information....
>>>>
>>>
>>> You can set the security level to its lowest setting of "medium"
>>> in the Java control panel.  Or, also from the control panel,
>>> you can white-list various locations such as "http://localhost/",
>>> "https://localhost/", and "file:///".  (You will get warning when
>>> adding http or file protocol URLs, but you can ignore those for
>>> localhost.)
>>>
>>> Or you can obtain a signing certificate and sign your code.
>>>
>>
>> Thanks Wayne, I think we're heading in the right direction but I need some more
>> detail....
>>
>> I've tried adding all of these entries to the white-list in the Security tab of the
>> Java Control Panel:
>>
>> http://localhost/
>> https://localhost/
>> http://127.0.0.1/
>> https:/127.0.0.1/
>> file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.html
>> file:///C:/Users/rhino_000/Documents/NetBeans/HelloWorld/dist/HelloWorld.jnlp
>>
>
> Those last two URLs are illegal, so I doubt they'd help.
>
>> I'm running Windows 8.1. When I double-click on the HelloWorld.jar in File Explorer
>> here on the laptop, the application launches just fine. When I right-click on the
>> HTML file and open it in Firefox, the Test Page for HelloWorld shows a "loading"
>> animation that just keeps spinning and spinning and spinning but never gets done.
>>
>> When I right-click on the JNLP file in File Explorer, I get the Web Start "Java ..."
>> splash screen, then I'm back to the error message I reported in my initial post in
>> this thread.
>>
>> Hmm. I just added the following to the white-list:
>>
>> file://
>
> Try it with three slashes.  Hierarchical URI protocols always end in "://"
> (while non-hierarchical ones end in ":").  So that URI doesn't specify
> any particular host/codebase.  A third slash conventionally means localhost.
>
Sorry, I just checked and I mistyped the previous post: the protocol I 
added was file:/// (three slashes, not two).

In fact, the white-list won't even ACCEPT file:// as valid; I get a red 
exclamation point and if I close it and come back, the file:// entry 
wasn't saved.

>>
>> Now, when I right-click on the JNLP file and choose Open With Java Web Start
>> Launcher, it actually launches without the error message! However, right-clicking on
>> the HTML file and opening it in Firefox works no better than it did before.
>
> Web browsers often have difficulty with that.  It has something to do with
> a confusion by the web browser if the resource is local or remote.  Different
> internal URIs are used.  I just run a local webserver, put my files in that,
> and use http://localhost/ to test 'em out.  This avoids using file:// protocols.
>
Fair enough. But doesn't that imply that I need to set up a server on my 
computer and then copy the files to that server? Or is there some simple 
way to use localhost to point to a specific file or directory on my hard 
drive that I've forgotten? I'm not coming up with anything like that in 
my Google search for localhost examples....

I should mention that I'm very rusty with some of this stuff.

> You can see if that's the problem by (temporarily) setting the security
> level to medium, and see if the problem goes away.  If so, you just need to
> get the URIs in the white list correct.
>

I turned security down to medium and get all the same symptoms as 
previously reported.
> Note, Java DOES NOT (yet) support IPv6 for specifying security parameters such
> as this white-list.  (I've asked.)  Since all hosts default to IPv6 first, then
> fall back on IPv4, you may see your browser using "localhost", but Java won't
> notice that if IPv6 to localhost is tried (by the browser).  In that case
> the IP address used to launch your Java app is "::1", not "localhost" or
> "127.0.0.1", and that will fail.  You can try to always use the
> "127.0.0.1 value in your URIs, that may also solve your issue.
>

I'm not clear on how to reference a file on my hard drive via localhost 
or 127.0.0.1. It's been a few years since I last messed with localhost 
and it's just not coming back to me clearly. Google isn't getting me to 
the right place yet either....

Sorry for being so dense!

I really just want to be sure that I can get a trivial program using 
JavaFX to work both on my laptop and on a server before I start to put 
major time into learning how to write JavaFX code for myself.


-- 
Rhino

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web