Re: Java Web Start



On Sun, 20 Dec 2009 01:55:43 -0800 (PST), The87Boy
<the87boy@xxxxxxxxx> 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 at http://lsmc.dk/test/launch.html
What have I done wrong?

If necessary I could also upload the source code

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)
.



Relevant Pages

  • Re: How to set the memory switches in JAR Executable
    ... >> The problem is, by the time the jar is loaded, the JVM is already ... >> loaded and has already laid out its memory map. ... The JNLP file is NOT inside the jar. ...
    (comp.lang.java.help)
  • Re: Need to revise my JNLP file
    ... and its "href" should provide the JNLP file in question, ... The line where "jar href" is defined ...   ... Thanks for the tip, John. ...
    (comp.lang.java.programmer)
  • Re: java webstart problem
    ... JavaHelp jar is already signed by Sun, so I use a separate JNLP to save ... Here is the main JNLP file. ... <java href="http://java.sun.com/products/autodl/j2se"</a>; ... All jars must be signed with the same certificate. ...
    (comp.lang.java.gui)
  • Re: Cant select 1.4.2 runtime in 1.5 applet control panel
    ... So why not use webstart? ... All you need to do is jar the classes and create a .jnlp file. ... Andrew Thompson ...
    (comp.lang.java.programmer)
  • Re: Jar signing is just not wotking
    ... load my jar and deploy it using jnlp file .. ... Does the JNLP file request extended permissions? ... web site is incorrect (they didn't add the DTD directive to their XML ...
    (comp.lang.java.programmer)