Java.lang.SecurityException

Source: Internet
Author: User

java.lang.SecurityException:Prohibited Package Name:java

At Java.lang.ClassLoader.preDefineClass (classloader.java:479)

At Java.lang.ClassLoader.defineClassCond (classloader.java:625)

At Java.lang.ClassLoader.defineClass (classloader.java:615)

At Java.security.SecureClassLoader.defineClass (secureclassloader.java:141)

At Java.net.URLClassLoader.defineClass (urlclassloader.java:283)

At java.net.urlclassloader.access$000 (urlclassloader.java:58)

At Java.net.urlclassloader$1.run (urlclassloader.java:197)

At java.security.AccessController.doPrivileged (Native Method)

At Java.net.URLClassLoader.findClass (urlclassloader.java:190)

At Java.lang.ClassLoader.loadClass (classloader.java:306)

At Sun.misc.launcher$appclassloader.loadclass (launcher.java:301)

At Java.lang.ClassLoader.loadClass (classloader.java:247)

Exception in thread "main"


The interesting exception that came up just now was that I defined my Code package as Java, which is what happens when I run the class under the package.

As can be seen from the stack information of the exception, this is the ClassLoader (ClassLoader) encountered a problem while conducting security checks.

The solution to this problem is, of course, very simple, so just change the name of the package. After all, you also need the ClassLoader to work.


Java.lang.SecurityException

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.