The JNLP nightmare - a summary

our application has the following preconditions:
* one EAR should work on the lab, the validation and the production environment with no security warnings
* we have to use 2 jnlp files
* we use native libraries
the conclusion we've drawn: this isn't possible with java webstart
reason:
1. the application has to be signed. hence the JNLP has to be signed. the current and only way to do this is to create a file JNLP-INF/APPLICATION.JNLP. and this is not a pattern, it's the actual filename. so if you have a start.jnlp, you still need to call the signed one APPLICATION.JNLP. this eliminates the possibility to have 2 jnlp files, since calling the not-signed-one doesn't even create a warning, but it creates an error message
2. the usage of placeholders like "$$codebase" is impossible since the signed jnlp file and the one from the webserver can never be identical. the binary comparison fails because the one from the webserver has eg the resolved hostname while the signed one of course has the placeholders. you could remove the placeholders by hardcoding the urls, but this eliminates the possibility of using the same ear in lab, val and prod environment.
3. since we have to use native libraries, we need to use the <security><all-permissions/></security> tags. this of course forces a certificate validation and because of the above we run into warnings
question: does anyone know a way to create a securitymanager/policy file which allows access to everything without getting a warning when you download a jnlp file? leave the security concerns aside, the question is if it is possible at all.
hope this might help others to not waste hours and hours of research only to find out that webstart is very limited
Edited by: user8995776 on Oct 1, 2010 4:55 AM

thank you, i know that link, been through it already during research.
and thank you for your consideration. i'd be glad if you find something that we missed. here's the jnlp code:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="$$codebase" href="$$name">
  <information>
    <title>Title</title>
    <vendor>Vendor</vendor>
    <homepage href="http://www.homepage.com"/>
    <description>Description</description>
    <description kind="short">[PENDING]</description>
    <icon href="$$codebase/../icons/icon.gif"/>
    <icon kind="splash" href="$$codebase/../icons/welcome.png"/>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se version="1.5+" java-vm-args="-Xmx300m"/>
    <jar href="myapp.jar"/>
    <jar href="log4j-1.2.15.jar"/>
    <jar href="commons-lang-2.4.jar"/>
    <jar href="commons-cli-1.2.jar"/>
    <jar href="jawin-stubs.jar"/>
    <jar href="jawin.jar"/>
    <jar href="jacob.jar"/>
    <nativelib href="jacob.dll.jar"/>
    <jar href="jbossall-client.jar"/>
    <jar href="swing-layout-1.0.jar"/>
    <jar href="ognl-2.6.7.jar"/>
    <nativelib href="jawin.dll.jar"/>
   </resources>
   <application-desc main-class="com.vendor.MainApp">
    <argument>-param</argument>
    <argument>arg</argument>
  </application-desc>
</jnlp> in addition, here's a related bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6653241
and the relevant source code part from java itself:
   private static final String SIGNED_JNLP_ENTRY = "JNLP-INF/APPLICATION.JNLP";
    /** Returns true if the JNLP file is propererly signed - otherwise false
     *  Only applications that request unrestricted access needs to be signed
    static private byte[] getSignedJNLPFile(LaunchDesc ld, boolean forceMain)
    throws IOException, JNLPException  {
        if (ld.getResources() == null) return null;
        JARDesc mainJar = ld.getResources().getMainJar(forceMain);
        if (mainJar == null) return null;
        // Lookup main JAR file in cache - should already have been downloaded
        // at this point
        JarFile jarf = null;
        try {
            // pass in false to JarFile ctor so no verification will be done to
            // minimize performance impact
            jarf = new JarFile(DownloadEngine.getCachedResourceFilePath(
                mainJar.getLocation(), mainJar.getVersion()), false);
            JarEntry sjfe = jarf.getJarEntry(SIGNED_JNLP_ENTRY);
            if (sjfe == null) {
                // Search no case sensitive
                Enumeration allnames = jarf.entries();
                while(allnames.hasMoreElements() && sjfe == null) {
                    JarEntry jfe = (JarEntry)allnames.nextElement();
                    if (jfe.getName().equalsIgnoreCase(SIGNED_JNLP_ENTRY)) {
                        sjfe = jfe;
            // No entry found
            if (sjfe == null) {
                return null;
            // Read contents of signed JNLP file into bytearray
            byte[] signedJnlp = new byte[(int)sjfe.getSize()];
            DataInputStream is = new DataInputStream(jarf.getInputStream(sjfe));
            is.readFully(signedJnlp, 0, (int)sjfe.getSize());
            is.close();
            return signedJnlp;
        } finally {
            if (jarf != null) {
                jarf.close();
    }

Similar Messages

  • How to disable access to internet completely in the jnlp file

    Hi All,
    Can someone help me in figuring out how to disable access to internet completely in the jnlp file.
    To be specific with the scenario if the client does not have the JRE installed, i would like to have it downloaded from the server where application runs instead of going to java.sun.com website which needs internet access.
    How can we configure it in such a way that it does not go to internet at all.
    Here is the snapshot of my jnlp file
    <j2se version="1.5.0+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="128m" max-heap-size="128m"/>
    I tried with the following and still unsuccessful.
    <j2se version="1.5.0+" initial-heap-size="128m" max-heap-size="128m"/>
    Could not find any useful information in the documentation.

    see post from Mike at:
    http://forum.java.sun.com/thread.jspa?threadID=704112&messageID=4082098#4082098
    for how to set up your own autodownload of jre from within your internet.
    /Andy

  • How to set  max-heap-size outside the jnlp file?

    Due to bug_id=6631056 It may not be possible to specify max-heap-size within
    the JNLP file for certain jnlp java applications.
    Are there other possibilities to specify this Jvm parameter?
    In the ControlPanel there is the possibility to specify Xmx for applets but not for jnlp.
    I have tried to add properties like
    "deployment.javaws.jre.0.args=Xmx\=128M" without success
    Many thanks

    Even in JNLP also you can specify the max heap size
    <j2se version="1.5+" initial-heap-size="128m" max-heap-size="512m"/>
    Thanks,
    Suresh
    [http://sureshdevi.co.in|http://sureshdevi.co.in]

  • Download  resources that are not listed in the JNLP file

    There is some way to download resources that are not listed in the JNLP file, and then
    ask for them with DownloadService ? (isResourceCached)
    thanks.

    currently, the jnlp spec requires DownloadService to access only resources specified in the jnlp file..
    changing this is a proposed RFE for the next spec version:
    4908304: JWS DownloadService should not require mention in JNLP file
    /Dietz

  • How to load .jar files when not specified in the .jnlp file

    Hello,
    We are deploying an application with JWS but due to the nature of this app, we need to download additional jar file only when the user has been authenticated. The jar file(s) we need to download can hardly be predicted (in term of name) and thus cannot be all listed as lazzy resource in the .jnlp file.
    However, we would like to take advantage of the various JWS features relateed to .jar download and cache and would prefer not to reinvent the wheel by implementing our on stuff (i.e. URLClassLoader with caching etc.).
    Any idea, suggestion?
    Thanks in advance.
    Fred.

    How about writing a second jnlp file with the optional jar listed in it and running it only if your user is authenticated?

  • Does the Browser cach the jnlp-file?

    I have a problem, I think with the browser's caching. As I modify the *.jnlp-File, the old version is loaded, not the new one!
    Or is the old version cached by the webStart-Caching-Mechanism?
    To update the jnlp-file, sometimes it is helpful to clear the Clients webStart cache.
    Is that correct?
    regards,
    ulli

    The browser does in fact cache the jnlp and it can be a real problem. If there is no expiration on the JNLP then the browser may load it from cache instead of going to your web server on the next access. This means you may have modified your JNLP on the server for a new release, but users can start your application WITHOUT GETTING THE LATEST JNLP!
    You can solve this problem by serving the JNLP file from your own servlet (or other HTTP serving technique) and setting the expire header. Setting it to 0 does the right thing.
    Do NOT however, set "Pragma", "no-cache". no-cache stops the browser from writing the JNLP to the file system...this in turn causes a problem when Web Start tries to find the jnlp file after the browser starts Web Start....the jnlp file is not there.
    Note that the JnlpDowloadServlet provided by Sun in the Web Start developers kit does NOT expire the JNLP file...you must fix this code yourself if you want it to work correcly. Sun was supposed to make this source code available but I can't find it anywhere. We used a de-compiler to de-compile the code, fix it and re-jar it.

  • Can we include the customize results in the Open Script Result Summary

    hi all
    can we include the customize results in the Open Script Result Summary if we include what is the code.
    customize result i mean
    Scenario: i am checking the concurrent job is completed successfully or not
    result:Concurrent Job Completed Successfully
    i am want to see the above result in the Open Script Result Summary can anybody help me on this.

    You want to launch a concurrent program, right? And to check the result, right?
    Is that for a functional test script or a load test script?
    Let's say it's functional. You have basically 2 options:
    * Do it separately. You create a scenario which launches the program and you write the RequestID in a file, then you create a second script which read the file and then go to the concurrent processing dashboard and search for the RequestID and check the status. You have to desynchronize the 2 scripts. Launch the first one. And then, later on, launch the 2nd one when you are sure the program is finish.
    * You do it in one single script and you wait til you get the status. See the code below I've written for a customer (for a POC);
    This is not the best option in my opinion because you don't know how long you need to wait and therefore you block other scripts execution... But the customer wanted it like this.
                   do {
                        delay(5000);
                        forms
                                  .textField(
                                            "//forms:textField[(@name='JOBS_PHASE_0')]")
                                  .storeAttribute("Batch_Phase", "text");
                        info("Phase du traitement: {{Batch_Phase}}");
                        forms
                                  .button(56,
                                            "//forms:button[(@name='JOBS_REFRESH_0')]")
                                  .click();
                   } while ((eval("{{Batch_Phase}}").equals("Running")));
    But wait, after having written all the stuff above, maybe you just want to check the toolbar status, is that correct?
    Normally, OpenScript automatically insert a "status bar test".
    Then I guess there's a default time-out (30 or 60 sec I think), you can maybe change to adapt.
    Well, looping could also be an option as i describe above.
    Let me know
    JB

  • Can the JNLP and the jarred application be on different servers

    Can the JNLP and the jarred application be on different servers? If so, how would I alter my JNLP file to include the url of the second server?
    The reason I ask this is that my app is being uploaded to a shopping cart, to be available for purchase. The problem is that this shopping cart allows ONLY one upload for each item that's available for purchase, and the vendor of my shopping cart say that for security reasons I cannot store files in other places on that server. The problem is that I need the JNLP and the JAR for download. I thought that the simplest solution is to put the JAR on a different server, and in the jnlp specify the URL of the jar. Is that possible? Or, do you see another solution?
    I appreciate your help - I REALLY need to take care of this ASAP!
    Here's my jnlp:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp
    spec="1.0+"
    codebase="http://server_where_jnlp_is/subdir/"
    href="myjnlp.jnlp">
    <information>
    <title>Title</title>
    <vendor>vendor</vendor>
    <homepage href="http://www.homepage.com" />
    <description>bla bla bla</description>
    <icon href="icon.gif"/>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.2+" />
    <jar href="myapp.jar"/>
    <nativelib href="libs.jar"/>
    </resources>
    <application-desc />
    </jnlp>

    I worked it out! What I did was I changed the jar href and the nativelib href to point to a different server
    eg:
    changed <jar href="myapp.jar"/>
    to
    <jar href="http://www.otherserver.com/myapp.jar"/>

  • How to run the JNLP from Command Line

    Hi All,
    how to run the JNLP file from the remote machine from our command line. I have requirement to run this JNLP file in java 1.4.2 version. Can any one tell me the procedure or the steps that are needed to run this file at command prompt.
    Regards,
    Prasanna.
    Edited by: VPrasanna on May 19, 2008 4:43 AM

    >
    I am getting "**java.security.AccessControlException: access denied (java.net.SocketPermission wwwgate0.mot.com:1080 connect,resolve)**" when I start the Web Start Client. >This seems like a largely separate problem to running the JNLP from the command line. It might have been better to end this thread (assign the dukes) and start a new one.
    >
    ..Can you help me in resolving this issue. >However, I suspect I can guess the problem.
    If this app. is normally hosted on wwwgate0.mot.com then it can 'phone home' to the server without further permission, but if you are running it from the command line, that might not be the codebase anymore.
    If you wish to do 'local testing' of such an app., I would recommend setting up a server like Tomcat on the local machine, and serving the test app. directly off that.
    >
    ..Its urgent...>Sun offers a number of options for urgent matters, such as support tickets. Perhaps you should look into one of those.

  • Fail to update the jnlp file

    The application allowed user to run offline. So ,I use <offline-allowed/> in the JNLP file.
    It works well in JDK5.0:
    1.the application can run if the network is dropped.
    2.the jnlp file will be updated if the server update the JNLP.
    But in when I change JDK to version 1.4.2, something unreasonable happened:
    Even I update the server's JNLP, the client still use the old JNLP and not update it.
    In the JWS1.4.2 Developer Guide, it says:"If offline-allowed is specified, Java Web Start will also check to see if an update is available. However, if the application is already downloaded the check will timeout after a few seconds, in which case the cached application will be launched instead."
    What is the "a few seconds" mean?Is there any different between JDK1.4 and 1.5?
    The connection between client and server is not very good. I do think it may cause the problem above. But in the same connection condition, JDK1.5 works..
    So, is there any thing I can do to resolve this problem?

    <jse version="1.5+" />(is one possibility)

  • The jnlp update process is corrupting the cache through hotspot network

    Hi all,
    This post is about a problem from the Java cache. We have a jnlp file responsible of updating our app (so we cannot put it “offline”). The problem is that some of our users run the application behind a hotspot network through wireless. In this case, they have no access to Internet but the java webstart mechanism try to download the JNLP in despite of this. In this case, JWS downloads the HTML login page and put it in its cache without any check. In consequence, the next access through shortcut is impossible.
    Is it a known issue and is there a workaround?
    Thanks in advance for your replies

    FYI
    We have removed the tag href from jnlp file and it's now ok. The jnlp is never updating but it's ok for us.

  • Download correct JRE before launching the jnlp application

    Hi,
    I have this requirement that before launching the jnlp application, the code should check the version of JRE installed on client's system, if it is less than 1.6 u10 then install the latest available JRE before launching the application.
    I am using the Java Script in my jsp to achieve this objective and it is working fine with non-IE web browsers. The trouble starts when the client machine is using 1.6.0_6 jre, in that case IE is not able to download /redirect user to the sun's page for the download of latest JRE.
    My java script code as follows:
    <script language="JavaScript">
    var launch = null;
    // try to check the JRE version installed on client's machine.
    //if its less than 1.6.10 redirect to Sun Micro systems website.
    //and then after installation, launch Receptionst and Call Center application
    function checkForInstalledJreVersionAndLaunch(appName)
         //detect browser used at client's machine
         var windowsIE = (navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1);
         if (windowsIE) {
              alert(windowsIE);
             document.write("<OBJECT codeBase=\"http://java.sun.com/update/1.6.0/jinstall-6u10-windows-i586.cab#Version=6,0,10,0\" classid=\"clsid:5852F5ED-8BF4-11D4-A245-0080C6F74284\" height=0 width=0>");
             document.write("<PARAM name=app VALUE=\"http://localhost:8080/"+appName+"/launch.jnlp\">");
              document.write("<PARAM NAME=back VALUE=true>");
              document.write("</OBJECT>");
         }else{
              if (navigator.mimeTypes && navigator.mimeTypes.length)
                   if(!checkWebStartWersion())
                        window.open("http://jdl.sun.com/webapps/getjava/BrowserRedirect?locale=en&host=java.com","needdownload");
                   launch = setInterval('launchJNLP("http://localhost:8080/'+appName+'/launch.jnlp")',100);
    function launchJNLP(app) {
        if (checkWebStartWersion()) {
            clearInterval(launch);
            window.location = app;
    function checkWebStartWersion()
         var isMajorVersion = false;
         var isMinorVersion = false;
         navigator.plugins.refresh(true);
         if(navigator.mimeTypes['application/x-java-jnlp-file'])
              for(var i=0;i <navigator.mimeTypes.length; i++)
                   var pluginType = navigator.mimeTypes.type;
                   if(pluginType.indexOf("x-java-applet;jpi-version") > -1)
                        var jreVersion = pluginType.substring(pluginType.indexOf("_")+1,pluginType.length);
                        var jreUpdateNumber = parseInt(jreVersion);
                        if(jreUpdateNumber >= 10)
                             isMinorVersion = true;
                   if(pluginType.indexOf("x-java-applet;version") > -1)
                        var jreVersion = pluginType.substring(pluginType.indexOf(".")+1,pluginType.length);
                        var jreUpdateNumber = parseInt(jreVersion);
                        if(jreUpdateNumber >=6)
                             isMajorVersion = true;
         return (isMajorVersion && isMinorVersion);
    function launchApplication()
         checkForInstalledJreVersionAndLaunch("appname");
    </script>

    I hear your frustration. I am attempting to do something similar.
    To me, it looks like this ActiveX control has no ability to detect a minor version of JRE. It knows if some JRE 1.6 is installed or not, but not if say JRE 1.6.0_10 or higher is installed. But, if it finds that some JRE less than 1.6 is installed such as a 1.5 version, this ActiveX control can automatically install the latest JRE 1.6.0_12. This seems to work well for me. But, the overall behavior is not consistent. It looks to me that this ActiveX control is only good for making sure that the client has some version of JRE 1.6. It doesn't care which one.
    A similar issue exists if you try to use Java WebStart to automatically download the correct JRE 1.6 version.
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />As of today, this code will tell Java WebStart that it needs some version of JRE 1.6 or higher to run your app. If the client does not have it, Java WebStart will download and install 1.6.0_07. Apparently, WebStart thinks that version is a "good" one - whatever that means.
    If instead you use this in your .jnlp file:
    <j2se version="1.6.0_10+" href="http://java.sun.com/products/autodl/j2se" />Java WebStart will not run your application unless the client has at least 1.6.0_10 installed. However, it is not able to install this version if the client does not have at least 1.6.0_10 already installed. It isn't smart enough for that. It looks like no one at sun has gotten around to updating http://java.sun.com/products/autodl/j2se to deal with recent JREs.
    Maybe I'm missing something, but WebStart deployment is more difficult than it needs to be. Sun introduces all sorts of new things into minor versions of Java, but nobody seems to be interested in making sure that the end user can have seemless upgrade experience.
    And people wonder why Flash and AJAX have become so popular...
    There probably is another workaround using a Java applet to determine what version is really installed before launching WebStart, but it just seems like an ugly hack to me. If an older version of Java 1.6 is detected, you could direct the user to java.sun.com in a new browser window, just as in the case of Firefox in your code. Ugly, but it would probably work.

  • Dynamically generating the jnlp file

    Hi Experts,
    Im working on a project in which we launch the Eclipse RCP from the web UI (thin client).
    I want to dynamically generate the jnlp file cause I want to pass the session of the user from the web client to RCP.
    So for this i have thought of having a variable let say sessionID ,which will take value of the session
    sum thing like this...
    <application-desc main-class="com.rcp.core.HelloWorld">
    <property name="sessionID" value="$$userSessionId"/>
    </application-desc>
    But im not able to figure out how i will populate the sessionID variable.
    which class should be responsible for doing this?
    whether that class will be in the RCP code or in the Web code...i guess it is in the web code?
    Please if u can clarify these doubts then it will be great.
    Thanks
    ved

    usually you would use jsp or a servlet to generate the jnlp file.
    If you extend the JnlpDownloadServlet (found in the sample directory in the JDK) you can generate the session id.
    /Andy

  • How to fetch the data records in summary format based on previous day

    drop table T1;
    create table T1(Class, Fees_Collected, Submit_Date) as select
    'MBA', 100000, '7/30/2012' from dual union all select
    'Btech', 20000, '7/10/2012' from DUAL union all select
    'MBA', 45000, '8/1/2012' from dual union all select
    'Btech', 55550, '7/31/2012' from DUAL union all select
    'BBA', 250660, '7/30/2012' from dual union all select
    'MBBS', 44556000, '7/31/2012' from DUAL union all select
    'BDS', 420050, '8/1/2012' from DUAL union all select
    'BBA', 30450, '7/30/2012' from DUAL union all select
    'MBBS', 120450, '7/31/2012' from DUAL union all select
    'BDS', 45950, '7/30/2012' from DUAL union all select
    'MBA', 252450, '8/1/2012' from DUAL;My requirment is to fetch the records based on summary format to display the data with following columns -
    Class |Prev Day Traded Value |Prev Day % of Total |Prev Day % MBA
    Note - Previous Day definiton (Buisness Day) = calendar days - (weekends + US Holidays)
    Kindly help me, as i want to keep it customized so that without specifying the hard coded dates ( Previous Day) it runs through and provide me the resultset....
    All of your help and time is highly appericated.

    You mean business days I guess ?
    I use a function (I had to write it myself) <tt><b> next_business_day(p_start_date in date,p_days_count in number) return date </b></tt>
    where I loop forward/backward from p_start_date according to the sign of p_days_count the required number of steps skipping weekends and holidays as the absolute value of p_days_count is mostly under 30 for the rest (at least around here) Oracle's <tt><b> add_months </b></tt> gets it done.
    Regards
    Etbin
    Edited by: Etbin on 6.8.2012 17:55
    Year till date: <tt><b> your_date between trunc(sysdate,'year') and sysdate </b></tt> is it ? http://en.wikipedia.org/wiki/Year-to-date ?
    Edited by: Etbin on 6.8.2012 18:27
    NOT TESTED!
    function next_business_date(p_start_date in date,p_count_days in number) return date is
      steps  number := abs(p_count_days);
      retval date := p_start_date;
    begin
      if p_start_date is null or p_count_days is null then
        return to_date(null);
      end if;
      while steps > 0
      loop
    /* skipping weekends and (yet to be implemented) holidays */
        while to_char(retval,'dy') in ('sat','sun') /* or is_holiday(retval) */
        loop
          retval = retval + sign(p_count_days);
        end loop;
    /* retval contains a business day now */
        retval = retval + sign(p_count_days);
        step := step - 1;
      end_loop
      return retval;
    end;

  • Can I get the name of the jnlp file used to launch my application

    Does anyone know if there is a way to get the name of the jnlp file used to launch the currently executing code?
    Essentially in the code below a way to set myAppFileName without hard coding the string. i.e. code could exist in a utility class used by many jnlp applications.
                String myAppFileName = "myApp.jnlp";
                BasicService bs = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService");
                String url = bs.getCodeBase() + myAppFileName;Seems reasonable that if the jnlp API's know about the codebase that maybe it could hold the file name somewhere too? I hope, I hope ....
    Thanks
    Mike

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

Maybe you are looking for

  • Windows 8 saying printer error, but still printing

    Okay so I just got a new labtop (hp) with windows 8 and the hp envy 4500 printer, everytime I print out something (via wireless connection) on the labtop in the right top corner, a popup will say error printing ( can't remember exactly what it says)

  • Mac OS X Lion kernel panic on shutdown (MacBook Pro 5,3)

    So lately I have been getting kernel panic on shutdown, running Lion 10.7.3 on my Mid-2009 Macbook Pro (Intel C2D, nVidia 9400M & 9600M GT) Reading the log it seems that it has something to do with the graphics card. prior to this, I did try to switc

  • HP Photosmart 8450 media card port

    The message window says that the media card is in upside down,please remove and re-insert.  I think someone has jammed a smaller card into the Smartmedia port but I can't see it much less get to it with tweezers .  Can I open up the access panel and

  • Problem with MAC Pinning and new VLAN

    [Cross posting to Nexus 1000V and UCS forums] Hi all, I have a working setup of UCS 1.4 (3i) and Nexus 1000V 1.4 and as per the best practice guide am using 'channel-group auto mode on mac-pinning' on the Nexus uplinks. I am having trouble when addin

  • Imac g4 won't boot - odd band appears on screen

    Computer was in sleep mode. Cannot boot from install disk. Below are 3 images showing the progression when I turn it on. I reset the PRAM or whatever it's called, to no avail. Options?