security - Java applet stopped working after update to JRE 7u21 -


my java applet stopped working once jre updated 7u21.

short summary:

  • the exceptions are: netscape.javascript.jsexception and
    java.lang.noclassdeffounderror. applet worked fine until jre 7u21.

  • the applet embedded in web page using oracle's deployjava.js.

  • the applet signed, uses liveconnect fire events, access usb , serial ports through jni, uses code multiple jar files.

  • the failure happens on desktop browsers tested (firefox, chrome, ie8/9 , safari on mac).

details:

  • i have java applet allows website communicate usb device.

  • the applet has been working past year.

  • once jre7 update 21 released - applet stopped working.

  • the applet hosted in web page (asp.net) using oracle's deployjava.js library.

  • it uses liveconnect raise events javascript code.

the first problem had on jre 7u21 exception on first attempt raise event through liveconnect:

netscape.javascript.jsexception: javascript error while calling "_notify" @ sun.plugin2.main.client.messagepassingjsobject.newjsexception(unknown source) @ sun.plugin2.main.client.messagepassingjsobject.waitforreply(unknown source) @ sun.plugin2.main.client.messagepassingjsobject.call(unknown source) @ <myapplet>.firejavascriptevent(unknown source) @ <myapplet>$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ com.asec.easypark.applets.homeloadingapplet.start(unknown source) @ com.sun.deploy.uitoolkit.impl.awt.awtappletadapter.start(unknown source) @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(unknown source) @ java.lang.thread.run(unknown source) 

in order mitigate problem added following line 'manifest' section in ant script applet:

attribute name="trusted-library" value="true"  

i built applet using jdk 7u21 , seemed help:

after started getting error - believe 1 solved, may have caused next problem.

the second problem this: applet calling code several jar files. on first call code in jar file (not of applet) fails following exception:

**java.lang.noclassdeffounderror**: com/codeminders/hidapi/hidmanager     @ <packageinsecondjar>.communication.hidtransmitter.open(unknown source)     @ <packageinsecondjar>.communication.hidtransmittersearcher.find(unknown source)     @ <packageinsecondjar>.communication.compositetransmittersearcher.find(unknown source)     @ <packageinappletjar>.communication.appletcommunicationbroker.setupdeviceproxy(unknown source)     @ <packageinappletjar>.communication.appletcommunicationbroker.setup(unknown source)     @ <packageinappletjar>.<theapplet>$1.run(unknown source)     @ java.security.accesscontroller.doprivileged(native method)     @ <packageinappletjar>.<theapplet>.start(unknown source)     @ com.sun.deploy.uitoolkit.impl.awt.awtappletadapter.start(unknown source)     @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(unknown source)     @ java.lang.thread.run(unknown source) 

i tried following measures - without success:

  • add http header 'cache-control' = 'no-cache'

  • add http header 'cache-control' = 'no-cache, no-store, must-revalidate'

  • use latest deployjava.js http://java.com/js/deployjava.txt (after renaming .js)

the applet has these features:

  • mark security ‘all-permissions’ in jnlp

  • the main jar signed certificate external ca

  • the applet code running inside accesscontroller.doprivileged block.

i'm java newbie please don't disregard obvious solutions...

thanks in advance help,

guy.

the error because jar file missing, or can not accessed applet. because:

  1. the jar on classpath of old jvm, not on new one.
  2. for reason distributing applet without jar inadvertently, , problem unrelated upgrade 7u2.
  3. the rules applets accessing external jar files has somehow changed, related security, , need else include them.

the jar file missing javahidapi, can found here: https://code.google.com/p/javahidapi/ . if make sure finds way classpath, applet work.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -