0

I have a Java applet. I am trying to open it with Java Web Start. I have created the following JNLP file:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://www.test.com/test"
 href="http://www.test.com/test/TestJWS.jnlp">
    <information>
        <title>Test</title>
        <vendor>Test</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.7+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="test.jar"
            main="true" />
    </resources>
    <security>
        <all-permissions/>
    </security>
    <applet-desc
         name="test"
         main-class="main.testApplet"
         width="300"
         height="300">
        <param name="TestParam" value="12345"/>
     </applet-desc>
     <update check="background"/>
</jnlp> 

Here is my manifest file:

Permissions: all-permissions
Trusted-Library: true
Codebase: *

When I try to open it in windows 8.1 or windows 7 there is no problem, everything works as expected.

But when i try to open it in Windows 10, applet cannot get the parameters which are defined in JNLP file. (I have tried it with j8u45 and j8u51)

I am trying to get the parameter with this method:

String java.applet.Applet.getParameter(String name)

Example: myTestApp.getParameter("TestParam")

Here is the stacktrace of the exception

java.lang.NullPointerException
    at test.XApplicationVariables.getParameters(XApplicationVariables.java:527)
    at test.MyApplet.init(TestApplet.java:71)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

How can I fix this problem? is there a workaround?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
e13420xx
  • 718
  • 1
  • 8
  • 26
  • Is this applet being launched free floating (in a frame, like applet viewer) or embedded in a web page? If 'embedded **in** web page', why? It will probably work regardless of the browser if it is free floating. In the meantime, be sure to check the JNLP using JaNeLA, available at my [share drive](https://drive.google.com/drive/#folders/0B5B9wDXIGw9lUnJaUjA2cmlVRE0). – Andrew Thompson Jul 21 '15 at 09:52
  • I'm still a little confused because we can deploy an embedded applet using JWS. Are you saying it used to be 'embedded **non** JWS' and will soon become 'free floating and **using** JWS'? – Andrew Thompson Jul 21 '15 at 11:17
  • it's embedded in a web page. (the reason is not technical.) As you know soon chrome will drop the support for NPAPI and also Microsoft edge does not support java plugin. Therefore in these browsers, we are planing to open our application wtih JWS, in other browsers we will continue to use applet.(For now, we do not want to move evertything from applet to desktop application. We are affarid that there may be bugs in jws since there are many forum entries about this. ) I am currently checking jnlp using Janela. There are some warnings.I will add the result soon. thank you for your response. – e13420xx Jul 21 '15 at 11:20
  • yes it is empedded non JWS and soon there will be two versions, one empedded non JWS, and the other using JWS – e13420xx Jul 21 '15 at 11:22
  • OK.. but if the only JWS version is free floating, I do not see how IE can stuff up the parameters in the JNLP. It has nothing to do with parsing them or providing them, beyond supplying the JNLP to the JWS client when requested. Have you checked it with JaNeLA yet?. – Andrew Thompson Jul 21 '15 at 11:26
  • i am analysing it. i pasted a screenshot of the result in here http://postimg.org/image/s6tg24b2n/ – e13420xx Jul 21 '15 at 11:37
  • there will be two parameter set one will be in web page for applet . other will be in jnlp file. we will redirect the user to the apropriate adress. But there will be only one jar file. which will be an applet. – e13420xx Jul 21 '15 at 11:40
  • *"..i pasted a screenshot.."* Why? If there are things in it you are not sure about, I'd need to read the **text report** that JaNeLA produces to be of further help. Anonymize the report if need be, but otherwise leave it unchanged and post it as an edit to the question (in code formatting). – Andrew Thompson Jul 21 '15 at 11:44

1 Answers1

0

Problem causes the way JRE handles parameters.

Suppose there is a parameter "Ip". JRE reads the parameters and lowercase them with current locale (in my case it was Turkish).

This changes "Ip" parameter to "ıp "

Therefore, when I tried to read Ip or ip in my application it does not find it.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
e13420xx
  • 718
  • 1
  • 8
  • 26