How to solve java. Security. accesscontrolexception: Access Denied

Source: Internet
Author: User
Instructor Fang: Today I debugged your jdbcupdateapplet Program .You can directly use IE to open the runapplet.html file. java. Security. accesscontrolexception: Access Denied will be reported on the Java console.
(Java. Lang. runtimepermission accessclassinpackage. Sun. JDBC. ODBC) error. This error message is also displayed here! Based on the analysis of related problems found on the Internet. this is because the applet is not allowed to obtain system resources. at the same time, the error message requires a runtimepermission, which will allow the applet to obtain sun. JDBC. ODBC package. therefore, you can modify a secure file in the Java runtime package of your system. the specific method is: Find the JRE package used by your IE browser. My home is: D:/program files/Java/jre1.6.0/lib/security. There is a Java under this package. policy file, open and edit it: Add two statements in grant: Permission Java. lang. runtimepermission "accessclassinpackage. sun. JDBC. ODBC ";
Permission Java. util. propertypermission "file. encoding "," read "; Disable IE and run it again to solve this problem. I added the above error message to my host at home. add the second statement because the applet can read some binary files. otherwise, Java. security. accesscontrolexception:
Access denied (Java. Lang. runtimepermission
File. Encoding read)
Error. The solution comes from an online discussion: http://java.sun.com/developer/onlineTraining/Programming/BasicJava1/dba.htmlhttp://www.javaworld.com.tw/jute/post/view? Bid = 29 & id = 71700 & TPG = 1 & PPG = 1 & sty = 1 & age = 0 these two addresses discuss and analyze this issue.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.