Problems with webstart

Hello,

I can't get webstart to work properly. Probably it is something very simple, but I can't get it right.

I compile a sample program, put it into a jar file, and sign it. If I execute it using java -jar ex1.jar it starts as it should,

but if I put it on a web-page and try to start it using a jnlp-file I get the following error:

Exception: java.lang.Exception.

java.lang.Exception

at com.sun.javaws.Launcher.continueLaunch(Unknown Source)

at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)

at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

If I on the other hand put a pre-compiled jar-file at the same location on the web-server this file starts using webstart.

My conclusion is that my jar-files won't execute and that this depends on a difference between versions of the JRE, but I have already re-installed both the JDK and the Mozilla-module. I've tried both <j2se version="1.5"> and <j2se version="1.6">

Does anybody know why?

Best regards

[1168 byte] By [Tom100a] at [2007-11-26 13:01:22]
# 1

Line 5 of your JNLP has no closing '/'.

That is my guess, based on a little scrying.

In the event that my exhortations to the spirit

plains have not been successful in eliciting the

correct information, you might try posting the

content of your JNLP, which is a much simpler

way to do this.

Other things might help are..

- a link to the application (if it is not too big,

secret, ridden with viruses) launch file,

or to an example that fails the same way.

- ..or failing that, a description of the file

structure of the site, listing the JNLP, &

each resource.

AndrewThompson64a at 2007-7-7 17:02:47 > top of Java-index,Desktop,Deploying...
# 2

Hello,

it doesn't seem to be that simple. The jnlp file I'm using is the following:

<?xml version="1.0" encoding="UTF-8"?>

<jnlp spec="1.0+"

codebase="http://bond.dyndns.dk/ex1"

href="ex1.jnlp">

<information>

<title>JNLP Test</title>

<vendor>Java Source and Support, Inc.</vendor>

<homepage href="http://www.java2s.com" />

<description>Demonstration of JNLP</description>

</information>

<resources>

<j2se version="1.5" />

<jar href="JNLPTest.jar"/>

I've put three examples on my server, in case somebody wants to have a look. The location is www.bond.dyndns.dk. The first example works. It's not my file. I downloaded the jar-file. The second file is the example above. The third is the java3D example which I began with...

Thanks in advance!

Tom100a at 2007-7-7 17:02:47 > top of Java-index,Desktop,Deploying...
# 3

Had a few problems running your example off the site,

mostly because it specified <j2se version="1.5" />,

rather than the more general <j2se version="1.5+" />.

Is this problem specific to 1.5? If not, please

try the following (new) example at the site.<?xml version="1.0" encoding="UTF-8"?>

<jnlp spec="1.0+"

codebase="http://bond.dyndns.dk/ex2"

href="ex2.jnlp">

<information>

<title>JNLP Test</title>

<vendor>Java Source and Support, Inc.</vendor>

<homepage href="http://www.java2s.com" />

<description>Demonstration of JNLP</description>

</information>

<resources>

<j2se version="1.5+" />

<jar href="JNLPTest.jar"/>

</resources>

<application-desc main-class="JNLPTest" />

</jnlp>

Basically, my machine is 1.6, and every time

I tried that JNLP, it requested I download an

earlier Java (1.5 - though I have at least 3x1.5

variants). In any case, I would cancel it and

therefore could not directly test it.

Local test results worked just fine when I

changed it to 1.5+, which brings me to..

> I've put three examples on my server, in case

> somebody wants to have a look. The location

> is www.bond.dyndns.dk. The first example works.

Works for me as well - note it specifies '1.4+'.

> ..It's not my file. I downloaded the jar-file. The

> second file is the example above. The third is

> the java3D example which I began with...

I could not test the second, because of the 1.5/1.6

thing, but as noted earlier, it runs locally when I

change it to 1.5+.

(BTW - could you remove the code that automatically

closes the hello world example - it is very irritating!

Leave it to the tester, they may need to copy

output from the console!)

Although I did not test the third, I noted that

it also specified '1.5', like the second.

Try it with '1.5+' (then we can discuss what version

this code actually needs to be..).

As an aside, I cannot immediately think how

J2SE versioning could impact the finding of the

resource jar, but ...

AndrewThompson64a at 2007-7-7 17:02:47 > top of Java-index,Desktop,Deploying...
# 4

Hi,

I've updated the jnlp files of the two last examples, but I still can't execute any of them using webstart. It may be something wrong with my installation, but I don't know what.

I'm using JDK 1.6.0, the latest version. I've installed it locally, not using root, in order to have control of the version used. Then I set a link to the mozilla plugin (/etc/mozpluggerrc). I've removed the earlier installations. Does Mozilla use anything except this file?

Tom100a at 2007-7-7 17:02:47 > top of Java-index,Desktop,Deploying...
# 5

> I've updated the jnlp files ..

(grimace) One thing I hinted in changes to

the file I posted, but forgot to otherwise mention,

is that it is best not to change existing

(failing, or otherwise) examples, but instead

to load the new example as another - separate

JNLP file - this way we can all keep clear on

which versions are failing, and why.

Another good reason for doing this, from

the developer's perspective, is that it helps

avoid the caching problems that sometimes

occur on dev. based machines (shrugs -

mine, which regularly crashes - at least!).

>...of the two last examples,

Only tried the first, because it works for me

off the net, now.

Console outputJava Web Start 1.6.0

Using JRE version 1.6.0 Java HotSpot(TM) Client VM

User home directory = C:\Documents and Settings\Administrator

Got the little 'Hello, JNLP' label/frame on-screen

( this time long enough to read it ;) ..but just to

be really bothersome, could you also set..

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)

.. so the VM ends and the console disappears!

> ..but I still can't execute any of them using webstart.

> It may be something wrong with my installation, but

> I don't know what.

Even the new ones? Did you try uninstalling

them completely first, or perhaps changing

the cache location temporarily - for the test?

> ...Does Mozilla use anything except this file?

Sorry, don't know - I have not been able to run

any Mozilla variant here for over a year..some

bothersome registry setting, most likely, but

I could not bother tracking it down.

AndrewThompson64a at 2007-7-7 17:02:47 > top of Java-index,Desktop,Deploying...