java - Loading JavaWS from desktop shortcut on OSX causes application crashes -


**update 11/30

this has been acknowledged javaws bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=jdk-8170522

the problem

we appear have uncovered bug java webstart implementation on os x, namely webstart applications fail launch external app via desktop.getdesktop().open(file file) api. occurs when java webstart app launched desktop shortcut. has seen behavior and/or can suggest workaround and/or additional avenues of testing?

the detail

on os x platform, when using api open external application such desktop.getdesktop().open(file file) within signed java webstart application external application load results in crash of application when javaws app launched desktop shortcut. when exact same webstart app launched directly jnlp file or cache in java control panel external application loads without issue. problem not occur on windows.

it easy replicate:

  • create simple project 1 class (demo class below). class tries desktop.getdesktop().open on rdp file
  • bundle jar , sign (self sign ok) (ant script below)
  • create simple jnlp file (sample below)
  • deploy jar , jnlp webserver accessed via https
  • add webserver's domain java's exception list self signed app run

test follows on os x client machine:

  • install latest microsoft remote desktop app (v8.0.35) - ensure rdp files associated app
  • ensure rdp client closed
  • download/run jnlp file webserver uploaded above
  • javaws app open , open rdp client , load rdp file
  • ensure rdp client , demo app closed
  • load demo app desktop icon <=== failure case
  • rdp client start open , crash
  • ensure rdp client , demo app closed
  • load app java cache <=== should have same behaviour loading desktop icon
  • app open , open rdp client , load rdp file

the same behavior has been observed command app can issue open application, i.e. not seen rdp files/app... when javaws app has been loaded desktop shortcut, every mechanism we've tried.

when loaded jnlp directly or java cache within java control panel exact same code works without issue. there no errors or warnings seen in code appears external command issued way jvm interacting os must differ in 2 scenarios.

can suggest can done change behavior of webstart app when loaded desktop shortcut , make windows , os x experiences consistent?

files replicate issue below:

demo class open command:

package com.example;  import java.awt.*; import java.io.file; import java.util.logging.logger;  public enum demo {     instance;    private static final logger log = logger.getlogger(demo.class.getname());    public static void main(string[] args) {   demo demo = demo.instance;    string filename = system.getproperty("user.home")   + system.getproperty("file.separator")   + "test.rdp";    log.info("opening file: " + filename);    demo.openfile(new file(filename));    }     public void openfile(file file) {    log.info("desktop.getdesktop().open(" + file.getabsolutepath() + ")");   try {    if (file.exists()) {   desktop.getdesktop().open(file);    } else {    log.info("cannot open file " + file.getabsolutepath() + " not exist.");    }   } catch (exception e) {   e.printstacktrace();    }   }  } 

demo jnlp file:

<?xml version="1.0" encoding="utf-8"?> <jnlp spec="6.0+"    codebase="https://yourwebserver.example.com/path/to/app"    href="opendemo.jnlp" >   <information>   <title>open demo</title>   <vendor>example</vendor>   <shortcut online="true" install="true">   <desktop/>   </shortcut>   <update check="timeout" policy="always"/>   </information>   <security>   <all-permissions/>   </security>   <resources>   <java version="1.8+" />   <jar href="./opendemo.jar" main="true" />   </resources>   <application-desc    main-class="com.example.demo" /> </jnlp> 

ant build file:

<?xml version="1.0" encoding="utf-8"?> <project name="build open demo webstart application">    <property name="compiled.basedir" value="../out/production/demo-webstart-app/" />   <property name="target.jarname" value="opendemo.jar" />     <!-- default target 1.8 -->    <property name="ant.build.javac.target" value="1.8" />   <property name="ant.build.javac.source" value="1.8" />     <!-- bundle jar -->    <target name="bundle">   <jar destfile="../${target.jarname}"    filesetmanifest="mergewithoutmain"    basedir="${compiled.basedir}" >    <include name="com/example/**" />   <manifest>   <attribute name="application-name" value="opendemo" />   <attribute name="codebase" value="*" />   <attribute name="permissions" value="all-permissions" />   <attribute name="caller-allowable-codebase" value="*" />   <attribute name="entry-point" value="com.example.demo" />   <attribute name="trusted-only" value="true" />   </manifest>   </jar>   </target>      <!-- sign have bundled self signed ca -->   <!-- cert created using:   keytool -genkey -keyalg rsa -alias selfsigned -keystore keystore -storepass opendemo -validity 30 -keysize 2048    first , last name?   [unknown]: opendemo   name of organizational unit?   [unknown]: opendemo   name of organization?   [unknown]: opendemo   name of city or locality?   [unknown]: opendemo   name of state or province?   [unknown]: opendemo   two-letter country code unit?   [unknown]: od   cn=opendemo, ou=opendemo, o=opendemo, l=opendemo, st=opendemo, c=od correct?   [no]: yes    enter key password <selfsigned>   (return if same keystore password):   -->    <target name="sign" depends="bundle">    <signjar    jar="../${target.jarname}"    lazy="false"    alias="selfsigned"    keystore="../keystore"    storepass="opendemo"    />   </target>  </project> 

problem specific remote desktop app on mac. remotedesktop client crashes , not java process spawns it. cause still unknown.

on windows remote desktop brought either web launch, cache viewer launch, or shortcut launch , on mac. but, crashes in desktop shortcut case on mac followed crash dialog comes options show details, exit (ok) or re-open.

work-around: select re-open dialog , remote desktop comes fine.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -