Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java Web Start

10 views
Skip to first unread message

The87Boy

unread,
Dec 20, 2009, 4:55:43 AM12/20/09
to
I made a program, which uses javax.swing (JFrame, JPanel and so on),
but when I try to execute the application using the launch.html,
Netbeans created I just can't see it
In the task manager (in Windows Vista) it shows, that javaw.exe is
starting each time
You can see the application at http://lsmc.dk/test/launch.html
What have I done wrong?

If necessary I could also upload the source code

markspace

unread,
Dec 20, 2009, 10:20:56 AM12/20/09
to


Here's the first issue I see: In your JNLP file, the code base seems wrong.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp
codebase="file:/C:/Users/Lasse%20Madsen/Desktop/Skole/NOEA/2.%20semester/Projekt/temapersis6/Rollespil/dist/"
href="launch.jnlp" spec="1.0+">

I'm pretty sure that your app isn't on my hard disc with the path
"file:/c:/User/Lasse Madsen/.. etc." This needs to be a path my system
can find relative to your server. It probably should start with
"http://lsmc.dk/...etc."

I've run into this problem myself with NetBeans and I don't have a fix
for it. Maybe try the NetBeans mailing list. If you find something,
please let us know.

Also you may have problems with caching when you try to edit the JNLP
file. You may need to set no-cache for the entire sub-directory tree
where it lives. This seems to be the easiest way to deal with the many
little files that applets generate.

Your mime types seem to be correct; partial download log below:

$ wget -r http://lsmc.dk/test/launch.html
--2009-12-20 07:08:43-- http://lsmc.dk/test/launch.html
Length: 731 [text/html]

--2009-12-20 07:08:44-- http://lsmc.dk/test/launch.jnlp
Length: 802 [application/x-java-jnlp-file]

Roedy Green

unread,
Dec 20, 2009, 4:40:27 PM12/20/09
to
On Sun, 20 Dec 2009 01:55:43 -0800 (PST), The87Boy
<the8...@gmail.com> wrote, quoted or indirectly quoted someone who
said :

When I ran it, it loaded and died with the following dump.


Exception in thread "AWT-EventQueue-0"
java.lang.ExceptionInInitializerError
at Gui.Login.<init>(Login.java:28)
at Gui.Login$4.run(Login.java:183)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied

<><><><><><><><><><>

(java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown
Source)
at java.security.AccessController.checkPermission(Unknown
Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown
Source)
at java.lang.System.getProperty(Unknown Source)
at DBLayer.DBConnection.<init>(DBConnection.java:38)
at DBLayer.Player.DBPlayer.<init>(DBPlayer.java:33)
at CtrLayer.CtrLogin.<init>(CtrLogin.java:47)
at CtrLayer.CtrLogin.<clinit>(CtrLogin.java:33)
... 10 more

Did your remember to sign your jar? See
http://mindprod.com/jgloss/javawebstart.html

Your JNLP file looks like this:

<jnlp spec="1.0+" codebase="http://lsmc.dk/test/"
href="http://lsmc.dk/test/launch.jnlp">
<information>
<title>Rollespil</title>
<vendor>Gruppe 6</vendor>
<homepage href="null"/>
<description>Management for roleplaying</description>
<description kind="short">Rollespil</description>
</information>
<update check="timeout" policy="always"/>
<resources>
<java java-vm-args="-Djava.security.policy=applet.policy"
version="1.6+"/>
<jar href="http://lsmc.dk/test/Rollespil.jar" download="eager"
main="true"/>
<jar href="http://lsmc.dk/test/lib/swing-layout-1.0.4.jar"
download="eager" main="false"/>
<jar href="http://lsmc.dk/test/lib/AbsoluteLayout.jar"
download="eager" main="false"/>
</resources>
<application-desc main-class="Gui.Login"/>
</jnlp>

There is no applet.policy file on my machine. Normally package names
are all lower case.

You might want to add lines to your JNLP file something like this:

<homepage href="webstart/replicator.html" />
<icon href="replicator.icon64.png" width="64" height="64"
kind="default" />

<icon href="replicator.splash.png" width="128" height="128"
kind="splash" />

<!-- create desktop shortcut to run the Replicator -->
<shortcut online="true">
<desktop />
<menu submenu="The Replicator" />
</shortcut>

<resources>
<!-- requires 1.6 -->
<!-- Sun JVM -->
<java version="1.6.0_17"
href="http://java.sun.com/products/autodl/j2se" java-vm-args="-ea"
initial-heap-size="128m" max-heap-size="512m" />
<java version="1.6+"
href="http://java.sun.com/products/autodl/j2se" java-vm-args="-ea"
initial-heap-size="128m" max-heap-size="512m" />
<!-- any vendor -->
<java version="1.6+" java-vm-args="-ea" initial-heap-size="128m"
max-heap-size="512m" />


<!-- set -D system properties -->
<property name="VIA" value="website" />
--
Roedy Green Canadian Mind Products
http://mindprod.com
The future has already happened, it just isn�t evenly distributed.
~ William Gibson (born: 1948-03-17 age: 61)

The87Boy

unread,
Dec 22, 2009, 6:17:50 PM12/22/09
to
On 20 Dec., 16:20, markspace <nos...@nowhere.com> wrote:
> The87Boy wrote:
> > I made a program, which uses javax.swing (JFrame, JPanel and so on),
> > but when I try to execute the application using the launch.html,
> > Netbeans created I just can't see it
> > In the task manager (in Windows Vista) it shows, that javaw.exe is
> > starting each time
> > You can see the application athttp://lsmc.dk/test/launch.html

> > What have I done wrong?
>
> > If necessary I could also upload the source code
>
> Here's the first issue I see:  In your JNLP file, the code base seems wrong.
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <jnlp
> codebase="file:/C:/Users/Lasse%20Madsen/Desktop/Skole/NOEA/2.%20semester/Projekt/temapersis6/Rollespil/dist/"
> href="launch.jnlp" spec="1.0+">
>
> I'm pretty sure that your app isn't on my hard disc with the path
> "file:/c:/User/Lasse Madsen/.. etc."  This needs to be a path my system
> can find relative to your server.  It probably should start with
> "http://lsmc.dk/...etc."
>
> I've run into this problem myself with NetBeans and I don't have a fix
> for it.  Maybe try the NetBeans mailing list.  If you find something,
> please let us know.
>
> Also you may have problems with caching when you try to edit the JNLP
> file.  You may need to set no-cache for the entire sub-directory tree
> where it lives.  This seems to be the easiest way to deal with the many
> little files that applets generate.

Thx for the help
I also had to sign the jar-file, which I have to read about first

The87Boy

unread,
Dec 22, 2009, 6:19:00 PM12/22/09
to
On 20 Dec., 22:40, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

> On Sun, 20 Dec 2009 01:55:43 -0800 (PST), The87Boy
> <the87...@gmail.com> wrote, quoted or indirectly quoted someone who

> said :
>
> >I made a program, which uses javax.swing (JFrame, JPanel and so on),
> >but when I try to execute the application using the launch.html,
> >Netbeans created I just can't see it
> >In the task manager (in Windows Vista) it shows, that javaw.exe is
> >starting each time
> >You can see the application athttp://lsmc.dk/test/launch.html
> Did your remember to sign your jar?  Seehttp://mindprod.com/jgloss/javawebstart.html

Thx for the help
I just had to sign the jar-file

Lew

unread,
Dec 22, 2009, 11:10:27 PM12/22/09
to
The87Boy wrote:
> Thx for the help
> I just had to sign the jar-file

I am so glad you told us what you discovered. I have no experience writing
applets and your solution taught me something I had not known. Likewise the
information from those who responded helped me, even though it didn't
necessarily bear on your specific situation.

--
Lew

Andrew Thompson

unread,
Dec 24, 2009, 6:30:49 PM12/24/09
to
On Dec 20, 8:55 pm, The87Boy <the87...@gmail.com> wrote:
>...

> What have I done wrong?

If I see the log-in prompt, did it work?

Try validating the entire launch using JaNeLA.
<http://pscode.org/janela>

--
Andrew T.
pscode.org

0 new messages