Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Web start on os X : Cannot open associated file.

Thread view: 
laurent - 31 Jan 2007 13:02 GMT
With "Java Web Start", I can associate a custom file type with a Java
application as described in "Java Web Start" guide
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/contents.html

<association mime-type="some_type/my_file" extensions="ext">
    <icon href="icon_file.png"/>
</association>

Then by double-clicking on associated file type my Java application is
launched and the associated file url is given to my Java application
with the "-open" argument.

It works nicely on Windows (with Java 6) but on Mac os X (10.4.8, java
1.5.0) no arguments, even the file url, is given to my application.

Did I miss something in "Java Web Start" ?

lc
Andrew Thompson - 31 Jan 2007 13:25 GMT
> With "Java Web Start", I can associate a custom file type with a Java
> application ...
..
> Then by double-clicking on associated file type my Java application is
> launched and the associated file url is given to my Java application
[quoted text clipped - 4 lines]
>
> Did I miss something in "Java Web Start" ?

Not sure.  Web start may or may not offer any
particular service or ability on specific platforms.
Recently I saw a problem where desktop icons
were supported on Win. but not a Linux variant.

OTOH, I think it is premature to make any
definitive statements without a validation of
your JNLP file (a DTD is included in the dev.
guide, AFAIR), and close inspection of it
(here - publicly).

Also, I have my very own example of usage
of the JNLP API file associations, it is
sandboxed (uses the FileOpen/SaveService)
and small, and I would appreciate test results
from both Win. and Mac. (and Linux).

It is here..
<http://www.physci.org/jws/#fs>

Note that you might score some test
results from other Macs. for your own
JNLP - if it is publicly available and you
psot the URL, but I am running Win XP,
with no Mac. access.

Andrew T.
laurent - 31 Jan 2007 16:45 GMT
Andrew Thompson a écrit :
>> With "Java Web Start", I can associate a custom file type with a Java
>> application ...
[quoted text clipped - 35 lines]
>
> Andrew T.

I have tested filetest.jnlp (http://www.physci.org/jws/filetest.jnlp) on
os X and it give the following result : When a *.zzz file is double
clicked, the program is started but the file itself isn't opened.

However, when "Java Web Start" application is launched from shell (on
Max.) with proper arguments , it  behaves as expected. For example the
following command :

javaws filetest.jnlp -open test.zzz

will start filetest application and display test.zzz file.

Maybe the problem relies on the "*.app" "shortcut" which is created by
"Java Web Start". A workaround could be to associate *.zzz file to a
script which launch "Java Web Start" with proper arguments.

Here is my jnlp file for validation :

<!-- JNLP File for STM Image Processor -->
<jnlp spec="1.0+" codebase="https://ipepc89.epfl.ch/simple"
href="simple.jnlp">
<information>
   <title>s.i.m.p.l.e</title>
   <vendor>Laboratory of Nanostructures at Surfaces</vendor>
   <homepage href="https://ipepc89.epfl.ch/simple"/>
   <description>Stm Image Processing - LNS - EPFL</description>
   <icon href="images/LNS_logo.jpg"/>
   <icon kind="splash" href="images/simple-logo.jpg"/>
   <offline-allowed/>
   <shortcut>
   <desktop/>
    <menu submenu="Stm Image Processing"/>
   </shortcut>
   <association mime-type="image/dat-file" extensions="dat">
     <icon href="images/dat-file-logo.png"/>
  </association>
</information>
<security>
  <all-permissions/>
</security>
<update check="background" policy="prompt-update"/>
<resources>
    <jar href="signed_jar/simple.jar" main="true"/>
    <jar href="signed_jar/log4j-1.2.14.jar"/>
    <jar href="signed_jar/jdom.jar"/>
    <jar href="signed_jar/BrowserLauncher2-all-10rc4.jar"/>
    <jar href="signed_jar/Jama-1.0.2.jar"/>
    <jar href="signed_jar/jcckit.jar"/>
 </resources>
 <resources os="Mac">
   <j2se version="1.5+" initial-heap-size="256m" max-heap-size="512m"/>
 </ressources>
 <resources os="Win">
   <j2se version="1.6+" initial-heap-size="256m" max-heap-size="512m"/>
 </ressources>
  <application-desc main-class="imgproc.ImgProcessor"/>
</jnlp>

Laurent C.
Andrew Thompson - 31 Jan 2007 18:14 GMT
> Andrew Thompson a écrit :
...
> >> With "Java Web Start", I can associate a custom file type with a Java
> >> application ...
..
> > OTOH, I think it is premature to make any
> > definitive statements without a validation of
> > your JNLP file

*

> > Also, I have my very own example of usage
> > of the JNLP API file associations, it is
[quoted text clipped - 4 lines]
> > It is here..
> > <http://www.physci.org/jws/#fs>
..
> I have tested filetest.jnlp (http://www.physci.org/jws/filetest.jnlp) on
> os X and it give the following result : When a *.zzz file is double
> clicked, the program is started but the file itself isn't opened.

:-(    Thanks for the result.  I take it, it works for you on Win.?

> However, when "Java Web Start" application is launched from shell (on
> Max.) with proper arguments , it  behaves as expected. For example the
[quoted text clipped - 3 lines]
>
> will start filetest application and display test.zzz file.

That is good to know..

> Maybe the problem relies on the "*.app" "shortcut" which is created by
> "Java Web Start". A workaround could be to associate *.zzz file to a
> script which launch "Java Web Start" with proper arguments.

OK - but that is hardly as good as 'having webstart
do it for us/the user - without further fuss'.

> Here is my jnlp file for validation :

* It is good you posted it, even to my eye it is
not valid, and once you have an invalid JNLP
file, you can rely on nothing beyond that..

> <!-- JNLP File for STM Image Processor -->
...
>   <resources os="Mac">
>     <j2se version="1.5+" initial-heap-size="256m" max-heap-size="512m"/>
>   </ressources>

  <!-- spell it correctly -->
  </resources>

>   <resources os="Win">
>     <j2se version="1.6+" initial-heap-size="256m" max-heap-size="512m"/>
>   </ressources>

  <!-- spell it correctly -->
  </resources>

>    <application-desc main-class="imgproc.ImgProcessor"/>
> </jnlp>

Andrew T.
Daniel Pitts - 31 Jan 2007 18:42 GMT
> > Andrew Thompson a écrit :
> > <!-- JNLP File for STM Image Processor -->
[quoted text clipped - 17 lines]
>
> Andrew T.

Spelling is for wusses :-)
j/k. That could certainly screw up an xml parser :-)
laurent - 01 Feb 2007 08:20 GMT
Andrew Thompson a écrit :

>> I have tested filetest.jnlp (http://www.physci.org/jws/filetest.jnlp) on
>> os X and it give the following result : When a *.zzz file is double
>> clicked, the program is started but the file itself isn't opened.
>
> :-(    Thanks for the result.  I take it, it works for you on Win.?

Yes, it works for me on Win.

>> However, when "Java Web Start" application is launched from shell (on
>> Max.) with proper arguments , it  behaves as expected. For example the
[quoted text clipped - 39 lines]
>
> Andrew T.

Tanks for the corrections

Laurent C.
Andrew Thompson - 01 Feb 2007 08:38 GMT
> Andrew Thompson a écrit :
>
> >> I have tested filetest.jnlp (http://www.physci.org/jws/filetest.jnlp) on
> >> os X
..
> > ...I take it, it works for you on Win.?
>
> Yes, it works for me on Win.

Thanks for confirming.

..
> >>   <resources os="Win">
> >>     <j2se version="1.6+" initial-heap-size="256m" max-heap-size="512m"/>
> >>   </ressources>
>
> >    <!-- spell it correctly -->
> >    </resources>
..
> Tanks for the corrections

No worries.  But note that 100 eyes as good
as mine, are not worth one validation against
the DTD.

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.