Association Entries Seem to be Ignored

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
userspaced
Posts: 4
Joined: 08 Jan 2025, 15:20

Association Entries Seem to be Ignored

Post by userspaced »

I currently have an app that has several file associations defined such as the following:

Code: Select all

<jnlp ...>
    <information>
        <association mime-type="application-x/<custom mime type>" extensions="*.xyz">
            <description>App File xyz</description>
        </association>
    </information>
</jnlp>
Everything works with this JNLP and my app downloads and launches fine. All shortcuts are created, etc, but the file associations never seem to get rendered. Doing this exact same thing with JWS worked great, but with OWS it's not working. Is the file association stuff supported in OWS?

Janak Mulani
Posts: 930
Joined: 24 Mar 2020, 13:37

Re: Association Entries Seem to be Ignored

Post by Janak Mulani »

I ran a sample Jnlp with Oracle JWS and OWS javaws:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/jnlp" href="webstart-monitor.jnlpb">
    <information>
        <title>WebStart Monitor</title>
        <vendor>Karakun AG</vendor>
        <offline-allowed/>
       <association mime-type="application/x-jnlpb-file" extensions="jnlpb">
                    <description>App File jnlpb</description>
        </association>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.8+"  />
        <jar href="generated-jars/webstart-monitor.jar"/>
    </resources>
    <application-desc main-class="com.karakun.ows.monitor.WebStartMonitorStarter"/>
</jnlp> 
I do not see any registry entry for .jnlpb in both cases.

Neither do I see any association when I type the command >assoc .jnlpb

Your jnlp file has extension ".xyz". Can you please tell me what registry entry do you see after Oracle JWS? What output do you see for the command >assoc .xyz?

userspaced
Posts: 4
Joined: 08 Jan 2025, 15:20

Re: Association Entries Seem to be Ignored

Post by userspaced »

I also do not see any association when I run that command. I was seeing the association in Windows 10 by opening Settings -> Apps -> Default Apps then selecting "Choose default apps by file type" at the bottom. Then if you scroll down to your extension you should see it in the list. In the case of Java 8/JWS I see Java Web Start Launcher as the app associated with my file. I don't get that in Open Web Start with openjdk 21.

I did some experimenting with seeing how it shows up in the registry. In the case of JWS/Java 8, I can see a bunch of registry entries for my extension. The important ones I believe are:

Computer\HKEY_USERS\S-1-5-21-2047949552-857980807-821054962-504\SOFTWARE\Classes\classxyz1

Under this key you'll see shell -> open and a default key with the javaws.exe command to launch the app.

This does appear to be different than how most other apps associate themselves with files, so perhaps that's why it doesn't show up with that assoc command.

When using OpenWebStart with openjdk21, I don't see any registry entries for the file extension. So it's like it doesn't even try to create it in that case.

Janak Mulani
Posts: 930
Joined: 24 Mar 2020, 13:37

Re: Association Entries Seem to be Ignored

Post by Janak Mulani »

I am using Windows 11.

I ran the above .jnlpb file with Oracle JWS.:

"Java Web Start 11.421.2.09
Using JRE version 1.8.0_421-b09 Java HotSpot(TM) 64-Bit Server VM"

I do not see any thing related to "jnlpb" in the registry and in "Apps > Default apps > Choose defaults by file type".

So was the registry entry that you see created by manually making the association? Or did you set anything in Java Config to enable associations when Oracle javaws is run?

Even when I run the above .jnlpb file with OWS javaws and Java 8, I did not see any registry entry and file association.

I checked the code of Icedtea-web on top of which OWS is built. It does process the <association> tag in the jnlp file but I did not find any action. Neither does Icedtea-web seem to be creating any registry entry containing "jnlp" or file association.

userspaced
Posts: 4
Joined: 08 Jan 2025, 15:20

Re: Association Entries Seem to be Ignored

Post by userspaced »

I created a dummy app with the following:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/Dummy" href="dummy.jnlp">
    <information>
        <title>Dummy</title>
        <vendor>ABC Inc</vendor>
        <offline-allowed/>
       <association mime-type="application/x-jnlpb-file" extensions="jnlpb">
                    <description>App File jnlpb</description>
        </association>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.8*"  />
        <jar href="dummy-1.0-SNAPSHOT.jar"/>
    </resources>
    <application-desc main-class="org.example.Main"/>
</jnlp> 
When I run it with Java Web Start on Java 8 I get the following prompt:
Image

When I click ok and look at the default apps list by file, I see this:
Image

If I do the same thing, but use OWS to run it, I don't get the file association, even when using Java 8.
I checked the code of Icedtea-web on top of which OWS is built. It does process the <association> tag in the jnlp file but I did not find any action. Neither does Icedtea-web seem to be creating any registry entry containing "jnlp" or file association.
That's what I found as well looking through it.

I guess it's safe to say this feature is not currently implemented/supported in OWS?

Janak Mulani
Posts: 930
Joined: 24 Mar 2020, 13:37

Re: Association Entries Seem to be Ignored

Post by Janak Mulani »

Yes <association> tag is not implemented although it is processed by the parser. But I wonder why the association is not created when I run the jnlp with Oracle JWS Java 8 u421? Did you set some property in the Java Control Panel:
JCP.jpg
JCP.jpg (90.32 KiB) Viewed 2343 times

userspaced
Posts: 4
Joined: 08 Jan 2025, 15:20

Re: Association Entries Seem to be Ignored

Post by userspaced »

Yes <association> tag is not implemented although it is processed by the parser. But I wonder why the association is not created when I run the jnlp with Oracle JWS Java 8 u421? Did you set some property in the Java Control Panel:
No, just the defaults. Very strange indeed.

Post Reply