I start a java applet on my website with deployJava.js from Oracle.
var attributes = { id:'applet',
code:'dummy.Applet.class',
archive: contextPath + '/jar/JAR_NAME.jar',
width:1,
height:1
} ;
var parameters = {jnlp_href: 'Applet.jnlp',
baseUrlParam: baseUrl,
serverConnectionType: 'REST',
java_status_events: 'true'
} ;
deployJava.runApplet(attributes, parameters, '1.6');
The problem is that if I call a java function from the javascript and the applet throw a RuntimeException, I can not catch this in a try-catch from Javascript. I catch everytime only the "Uncaught Error: Error calling method on NPObject." Error.
For example:
I call this function in javascript:
function getConfirmation(){
applet.confirmation()
}
Then the applet throw a ApplicationBaseException without a try-catch block I can see two errors:
Uncaught Error: dummy.ApplicationBaseException toperson.js:78
getConfirmation toperson.js:78
(anonymous function) toperson.js:53
b.event.dispatch jquery-1.9.1.min.js:3
v.handle jquery-1.9.1.min.js:3
Uncaught Error: Error calling method on NPObject.
getConfirmation
(anonymous function) toperson.js:53
b.event.dispatch jquery-1.9.1.min.js:3
v.handle jquery-1.9.1.min.js:3
but with a try-catch block I only can catch the NPObject error.
How can I catch the other error in Java-Script?