System.getProperty can't read jnlp - resources since java 7 - Could this be because of an unsigned JNLP-File

StackOverflow https://stackoverflow.com/questions/21848137

Question

I try to repear a Java Web Starter Application witch is broken since Java 7. It worked befor. All the Jar Files are signed.

I try to get the information of the resource-tag from my jnlp-file.

I use System.getProperty but it returns null.

I searched for a while but I didn't find an answer to the following Questions:

  1. Do I have to sign the JNLP-File to be allowed to get the resources tag?
  2. If I do, how can I do this? I read that I have to put it in the same jar like the start Class, but I didn't find a good instruction how to do this.
  3. I read, that the jnlp must be named APPLICATION.JNLP and musst be in the JNLP-INF folder. Is this necessary? There has this folder to be? Can he be anythere?
  4. I read the releaselog from oracle what is new in Java 7. I didn't found a change of the System.getProperty and the in this function used SecurityManager. Am I right, that this didn't change?

Here is the I think important Part of the Code:

Ok So this is the line i try to get one of the Resource-tag:

String strApiPath = System.getProperty("apipath");
System.out.println(strApiPath);

strApiPath is null.

The resources part of the jnlp looks like:

<resources> 

    <j2se version="1.5+" initial-heap-size="64m" max-heap-size="512m"/>


    <jar href="dist/pathtool-2.jar"/>
   <jar href="jars/resources.jar"/>
    <jar href="jars/reporting-api-javaclient.jar"/> 

    <jar href="jars/commons-collections-3.2.jar"/>
    <jar href="jars/colt.jar"/>
    <jar href="jars/jdom.jar"/>


    <jar href="jars/ptjung1.7.jar"/>

    <jar href="jars/commons-configuration-1.2.jar"/>
    <jar href="jars/commons-httpclient-3.1.jar"/>
    <jar href="jars/commons-lang-2.1.jar"/> 

    <jar href="jars/commons-logging-1.1.jar"/>
    <jar href="jars/commons-logging-api-1.1.jar"/>
    <jar href="jars/commons-codec-1.3.jar"/>

    <jar href="jars/jnlp.jar"/>


    <!-- http or https -->
    <property name="protocol" value="http"/> 
    <!-- Domainname or ip -->
    <property name="host" value="localhost"/>
    <property name="port" value="8080"/>
    <property name="proxyactive" value="false"/>
    <property name="proxyhost" value="false"/>
    <property name="proxyport" value="false"/>
    <property name="webuser" value="dummy"/>
    <property name="webpwd" value="dummy"/>
    <property name="apipath" value="../../api_basic"/> 
    <property name="user" value="123"/> 
    <property name="psw" value="123"/> 
    <property name="datasource" value="eval"/>

  </resources> 

No correct solution

OTHER TIPS

Starting in java7 update51 there are new requirements for web start applications.

  • All the jars need to signed (not with self-signed cert) with a certificate
  • The manifest file needs to be updated - see this link

Some of the output is warnings but the 'permissions' tag is the required tag.

What kinds of error are you getting?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top