properties defined in jnlp are not passed to java application

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
wenzel
Posts: 5
Joined: 19 May 2020, 09:22

properties defined in jnlp are not passed to java application

Post by wenzel »

I found that after upgrading to 1.10 properties in jnlp file in resources / property section are not passed to the application.

Is this a bug or a feature?

such as
...
<resources>
<property name="my.property" value="my_value"/>
..

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

Re: properties defined in jnlp are not passed to java application

Post by Janak Mulani »

Hi,

I just tried:

Code: Select all

<resources>
        <j2se version="1.8*"  java-vm-args=" -Xmx512m -Xms256m -Djnlp.ccc=jnlp"/>
        <jar href="generated-jars/jvm_args.jar"/>
        <property name="http.agent" value="jnlp"/>
        <property name="javaws.xyz" value="jnlp"/>
        <property name="sun.java2d.dpiaware" value="true"/>
        <property name="my.prop" value="jnlp"/>
        <property name="jnlp.prop" value="jnlp"/>
</resources>
I see all the jvm args and the properties in my Java program:
jvm_args.png
jvm_args.png (42.98 KiB) Viewed 1860 times
Do you have a invalid jvm arg which is iflagged by OWS (see logs) and thus it ignores all the specified jvm args?

wenzel
Posts: 5
Joined: 19 May 2020, 09:22

Re: properties defined in jnlp are not passed to java application

Post by wenzel »

It fails with no jvm argumetsset (or with java-vm-args="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED")

java 17 is used

<resources>
<j2se version="17*" />
...
</resources>

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

Re: properties defined in jnlp are not passed to java application

Post by Janak Mulani »

I am sorry I do not understand your issue. Please consider buying support https://openwebstart.com/support/

wenzel
Posts: 5
Joined: 19 May 2020, 09:22

Re: properties defined in jnlp are not passed to java application

Post by wenzel »

Using a minimal jnlp:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://...">
<information>
<title>TEST</title>
<vendor>TEST</vendor>
<!-- <offline-allowed/>-->
</information>
<security>
<all-permissions />
</security>
<resources>
<java version="1.8*" />
<jar href="jnlp-test-0.0.1-SNAPSHOT.jar"/>
<property name="a.test.property" value="A_TEST_PROPERTY"/>
</resources>
<application-desc main-class="jnlptest.main.Main"/>
</jnlp>

and a minimal java program that only outputs System.getProperties() does not output a.test.property with ows 1.10 but does with 1.9.1

I varied java versions (different vendors , java 1.8 , 17 ) , played with the jnlp ... w.o. success.

wenzel
Posts: 5
Joined: 19 May 2020, 09:22

Re: properties defined in jnlp are not passed to java application

Post by wenzel »

properties that start with jnlp (like name="jnlp.key") are passed others are ommited

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

Re: properties defined in jnlp are not passed to java application

Post by Janak Mulani »

I could reproduce. I will investigate and come back. Thanks for pointing to the issue.

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

Re: properties defined in jnlp are not passed to java application

Post by Janak Mulani »

This is a bug. We will fix it and make a new release soon. For now you can use the following workaround:

In your deployment.properties file please specify the following property:

Code: Select all

ows.jvmargs.for.<name_of_your_jnlp>=-D<propName1>=<propValue1> -D<propName2>=<propValue2>
So if the name of your jnlp file is my.jnlp, then the above property will be ows.jvmargs.for.my.jnlp.

Unfortunately you will have to specify all the missing properties in jnlp as -D<propnName>=<propValue>:.

Code: Select all

If  my.jnlp file has:

<property name="a.test.property" value="A_TEST_PROPERTY"/>
<property name="a.test.property_2" value="A_TEST_PROPERTY_2"/>

Then in deployment.properties you specify:

ows.jvmargs.for.my.jnlp=-Da.test.property=A_TEST_PROPERTY -Da.test.property_2=A_TEST_PROPERTY_2

Please let me know if this works.

Sorry for the trouble due to this bug.

Post Reply