Applet debugging issue- applet security warning not displaying when certificates removed
We've got a signed java applet that is called from as aspx via javascript (We're not really a Java development shop, were mainly C# devs).
I'm needing to debug through this applet but I'm having an isue that is not beeing seen on my colleagues machines.
To attach the netbeans debugger to the applet we've traditionally removed all certifcates from the 'Trusted Certificates' store via the Java Control pan开发者_运维问答el, deleted any cached applets (via the Java Control Panel) and then when the applet is downloaded and run, we see the security warning. At this point we able to attach the netbeans debugger, okay the security warnings (not checking the 'always trust' checkbox) and then having hit a breakpoint within the applet code, debug from there.
However, whatever I do I'm not seeing the security warnings, which makes it a bit hard to attach to the applet. I've removed our certificate, zapped any cached applets, I've even 'clutched at straws' and removed and reinstalled the JDK (we're using 1.6 update 7, update 10 and update 20; all updates we know work with our implementation). I just can't get the security warning to appear.
It's like I've got an 'always trust' flag permanently switched on.
Any ideas gratefully received.
The security warning comes only when the applet is signed. Otherwise the applet does not have any privileges, so it is not considered necessary to show the warning.
You could simply sign your applet with a new (untrusted, self-signed) key, maybe this helps.
You might try launching the applet using (non-embedded) Java Web Start. Launching with JWS you will lose JS functionality, but should regain easy control over the permissions.
Sorry, not a direct answer to your question, but if what you want is to pause the JVM at startup for debugging, you could use the suspend=n option in the JVM options, as in something like:
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=2502,server=y,suspend=n
That way, the JVM suspends automatically, waiting for a connection from the debugger.
精彩评论