0 Replies Latest reply: Jan 2, 2014 8:23 AM by 8e749db3-a82c-4ed2-bd6d-7b4157445ab6 RSS

    Problem with integration between JavaScript and Java Applet starting with version 1.7 update 21




      Not sure if anyone can help with this. We've hit a brick wall.


      Our application involves relatively complex interactions between JavaScript and an applet. Additionally the applet communicates with a C++ DLL via JNI.


      Some of the interactions between JS and the applet originate in JavaScript, pass to the applet, return to JS and then pass back to the applet i.e. a function in JS calls a method in Java which carries out some operations (possibly involving the DLL) and then calls another JS function which may then call back into the applet. Clear as mud


      Until 1.7u21 this worked as intended. However from this update our application now fails to work. The failure appears in both Internet Explorer from version 8 onwards and in Firefox. We have not tested in earlier versions of IE or in Chrome. The failure manifests as the browser 'hanging' and failing to respond to any interaction until it is restarted. No error message appears in the Java console, the browser console or the operating system logs. The problem appears not to be a failure at all but rather it appears that the browser is waiting for a transaction to finish. CPU and memory usage on the host machine are both normal.


      We've added:


      * a Permissions Manifest attribute;

      * a Codebase Manifest attribute;

      * a Caller-Allowable-Codebase attribute; and

      * a Trusted-Library Manifest attribute.


      The applet is signed and time-stamped.


      This is a critical failure and is preventing the release of the latest version of our software.


      We have extensively tested and have found that the problem only appears when the sequence of transactions described above is followed (JS>Java>JS>Java). The problem does not appear when the path followed is JS>Java>JS>stop and it does not seem to make any difference if the DLL is involved.


      To test different scenarios we created a small test program and the problem is reproducible in that as well.


      We have also found that putting in a JavaScript timer with even a single millisecond delay at the point the applet returns control to the JS is enough to work around the problem and allow the operation to continue as expected i.e. JS>Java>JS (1ms DELAY)>Java works. However we do not feel that this is sufficiently robust enough to release to our customers.


      If anyone has any ideas of what we may be missing it would be greatly appreciated.