Page 1 of 1
properties defined in jnlp are not passed to java application
Posted: 30 May 2024, 11:26
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"/>
..
Re: properties defined in jnlp are not passed to java application
Posted: 30 May 2024, 13:02
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 (42.98 KiB) Viewed 39245 times
Do you have a invalid jvm arg which is iflagged by OWS (see logs) and thus it ignores all the specified jvm args?
Re: properties defined in jnlp are not passed to java application
Posted: 30 May 2024, 14:07
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>
Re: properties defined in jnlp are not passed to java application
Posted: 31 May 2024, 08:23
by Janak Mulani
I am sorry I do not understand your issue. Please consider buying support
https://openwebstart.com/support/
Re: properties defined in jnlp are not passed to java application
Posted: 31 May 2024, 14:56
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.
Re: properties defined in jnlp are not passed to java application
Posted: 31 May 2024, 15:53
by wenzel
properties that start with jnlp (like name="jnlp.key") are passed others are ommited
Re: properties defined in jnlp are not passed to java application
Posted: 03 Jun 2024, 10:51
by Janak Mulani
I could reproduce. I will investigate and come back. Thanks for pointing to the issue.
Re: properties defined in jnlp are not passed to java application
Posted: 03 Jun 2024, 12:22
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.