Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Signed Applet Works In Brower Not In Debugger

 
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
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic