• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Signed Applet Works In Brower Not In Debugger

 
Dominic Siano
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the following error when I try and degbug my applet from the netbeans IDE 6.1.

Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)

The above error is created when the following code is executed:

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
.....

I have signed the applet and it will work fine in a webbrowser launced from html. I am not sure why the applet
gives me this problem from the debugger.

I really need to be able to debug the code. Any ideas ?

Thanks
 
Dominic Siano
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to get the debugger to work with the following policy file:

grant {
permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc";
permission java.util.PropertyPermission "file.encoding", "read";
};

In the Netbeans debugger I added the following line to the VM options Run Catagory:
-Djava.security.policy=C:\KnowledgeRepository\build\classes\applet.policy

I guess this was good enough to get me debugging my code, but if someone can provide input
as to why the applet will work after it has been signed and run from a browser but not in the netbeans debugger ?

One thing I forgot to mention in my last post was the following; after I compile and create the jar
I sign it and copy it into the directory where the applet if running from in the debugger. If I create
the html doc here and run from the browser all is good. In the debugger it will not work unless I
have the policy file. There seems to be an issue with the appletviewer in netbeans. The same project
debugs fine on another mach without any policy file.


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic