Im not very familiour with Java nor Java applets but I have to fix this issue.
Ever since JRE 7 Update 21 the applet is throwing eceptions in all browsers.
I need to debug the app, because the error gives no clues whatsoever (the application was running for years now, its after latest JRE update that the clients cant use it anymore).
So the applet is used as a JAR file in .NET application. It is called as javascript with some code:
<html>
<head>
<script type="text/javascript">
var i = 0;
var path = "\\\\\\\\reaktorm\\\\Outgoing\\\\test";
var ext = ".tif";
var fullPath = "";
function nextImage() {
if (i==2) {
alert("There is no next image in collection!");
} else {
i++;
displayImage();
}
}
function previousImage() {
if (i<1) {
alert("There is no previous image in collection!");
} else {
i--;
displayImage();
}
}
function displayImage() {
//fullPath= path + (i<10?"0"+i:i) + ext;
fullPath= path + ext;
alert(fullPath);
document.webViewer.display(fullPath);
}
</script>
</head>
<body>
<div style="width:100%; height:100%;">
<applet name="webviewer" archive="..\webviewer.jar" code="my.webviewer.WebViewerApplet.class" width="100%" height="100%">
<param name="java_arguments" value="-Xmx512m">
<param name="image_source" value="C:\test\test.tif">
</applet>
</div>
<form id="testForm" name="testForm" style="display:block">
<input type="button" onClick="previousImage();" value="previous" />
<input type="button" onClick="nextImage();" value="next" />
</form>
</body>
</html>
So if I put this in html file and open it in a browser, i get the upper RuntimeException.
Now I want to debug in order to find the reason for this exception. I have eclipse, the source code and an JAR export.
I have tried remote debug by launching:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar webviewer.jar
Then i tried to connect to that using "Remote Java Application" under Debug options in eclipse by connection to locahost:5005, but i get connection refused.
Please can some one point me to the solution - how can i debug this in eclipse?