Troubles with the type associations

Hello forum,

The type and extension association is really delicious, it's time this happens!

I've been trying it with moderate success, here are a few experiences, I would love advice for better results:

- first the example at http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#example

is non-well-formed. It's not long to fix but annoying.

I managed to make a first "jakarta commons jelly" web-start-application associated with .jelly files. The application can be found at:

http://klein.activemath.org/jnlpDev/webstartJelly/webstartJelly.jnlp

- on the Mac (10.4 i.e. jdk 1.5), this kind of works:

- the first launch launches the main

- the SingleInstanceListener is called at every double click on a jelly file, great! but the parameters are the original parameters (the javaws command behaves correctly though with -open).

- on Windows (Windows Server 2003, jdk 1.5), the association just doesn't work, the windows-explorer tells me to search for an application (and doesn't propose me Webstarted Jelly as it should). Do I need to restart ?

Any help for these two problems would be greatly welcome.

thanks

paul

[1240 byte] By [paul@activemath.orga] at [2007-11-26 15:21:11]
# 1

..

> http://klein.activemath.org/jnlpDev/webstartJelly/webstartJelly.jnlp

..hmmm. With 40 separate jar archives in this

application, I cannot say I am keen to try it

(at least not at this time of night, with my

connection bandwidth!).

How big is the application (all up) in bytes?

In any case, I have some examples as

well (much smaller) at..

http://www.physci.org/jws/

Most relevant are..

http://www.physci.org/jws/#fs

..which uses the FileOpenService

and claims a .zzz file extension, and..

http://www.physci.org/jws/#sis

..which deals with the SingleInstanceService

(unfortunately, I chose not to claim any

associations for the SIS example, but

you might download both build files and

copy the association from the file

service example JNLP, into the single

instance example.)

...

> - on Windows (Windows Server 2003, jdk 1.5),

> the association just doesn't work, the

> windows-explorer tells me to search for

> an application (and doesn't propose me

> Webstarted Jelly as it should). Do I need to restart ?

I have never needed to (on Win XP).

How does that PC go with my file

service example?

..also, I only just noticed this, but while

the JNLP from my example has ..

<association

extensions="zzz"

mime-type="text/sleepytime" />

..to claim a file extenstion, the current

version of the launch file linked above -

has no <association> element defined.

AndrewThompson64a at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...
# 2

..

> - the SingleInstanceListener is called at every double

> click on a jelly file, great! but the parameters are the

> original parameters (the javaws command behaves

> correctly though with -open).

I suggested in my last post that you try my SIS

example* using the file association defined for

the FOS example. I got a few moments, and

tried it myself.

After double clicking a sleepy1.zzz, and the

app. opening on-screen, I then double clicked

'sleepy2.zzz', then again 'sleepy1.zzz'.

Here is the result (each time/args output

line broken over two lines)Try openning another version of this application

Wed Jan 17 19:07:01 ACT 2007

Got new args: '-open' 'D:\projects\...\sleepy2.zzz'

Wed Jan 17 19:10:39 ACT 2007

Got new args: '-open' 'D:\projects\...\sleepy1.zzz'

So again I can say that here, on Win XP,

both of the services you mentioned are

'working as advertised'.

* The downloadable version is still the

old version without the 'file association'.

AndrewThompson64a at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...
# 3
Thanks Andrew,this definitely indicates this server machine was broken wrt javaws... sad!Have you been playing with associations of icons as well ?thanks again!paul
paul@activemath.orga at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...
# 4

Andrew,

you have a point about the 14 jars, it makes about 8Mb on the whole.

But now, what this would make working is that any jelly script on your hard disk can be double clicked and executed... almost any... so that's quite powerful!

paul

PS: note that from time to time the JNLP does not have the association, it's the maven default generated one and this one doesn't have these fancy features.... also I need one without for JDK 1.4 compatibility.

paul@activemath.orga at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...
# 5

> PS: note that from time to time the JNLP does not have

> the association, it's the maven default generated one

> and this one doesn't have these fancy features....

> also I need one without for JDK 1.4 compatibility.

On that last point, I think you do not need to worry.

Posts around this forum suggest to me that

when a Java Web Start launch client sees an

element in a JNLP that it does not understand -

it simply ignores it.

So a 1.5 client gets the program with file associations,

and the 1.4 client gets it without.

BTW - when was the 'associations' element introduced.

(I though it was before 1.5)

AndrewThompson64a at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...
# 6

>> PS: note that from time to time the JNLP does not have

>> the association, it's the maven default generated one

>> and this one doesn't have these fancy features....

>> also I need one without for JDK 1.4 compatibility.

> On that last point, I think you do not need to worry.

Since I could not be bothered looking up the

part of whatever spec. confirms that, I thought

I'd try a quick test and insert this*** element

in a JNLP for a current project.....

<offline-allowed/>

<ocelot pixeglottle='xxx' /> <!-- "***" -->

<association

extensions='sss'

mime-type='text/spacesimscenarios' />

...

The project prompted for the file associations,

came on screen as expected, and JWS never

even mentioned the ocelot element.

And the best part is, if ocelot support

is added to JWS in Java 1.8/1.9/n.n,

my project is covered ( assuming the

pixeglottle attribute is implemented,

..and a value of 'xxx' makes it do

..something useful - OK maybe I'll

take that part out! ;)

AndrewThompson64a at 2007-7-8 11:50:05 > top of Java-index,Desktop,Deploying...