Java. Lang. securityexception

Source: Internet
Author: User

Exception in thread "Main" Java. Lang. securityexception: Class "org. Eclipse. SWT. Widgets. ufccomposite"'s signer information does not match signer information of other classes in the spackame

Under what circumstances can this exception occur?
When you define a class in your own program that is the same as the built-in system (such as JDK and other libraries.
For example, define
Java. lang package. A class is defined under the java. lang package. When this class is loaded or used, a securityexception exception is reported.

 

Related Concepts:
What are the advantages of the parent delegation mechanism?
The advantage of the parent entrusting mechanism is that it can improve the security of the software system. In this mechanism, the user-defined class loader cannot be loaded and should be loaded by the parent loader.
To prevent unreliable or even malicious code from replacing the reliable code loaded by the parent loader.
For example, java. Lang. object classes are always loaded by the root class loader (bootstrap), and no other user-defined class loaders can load classes containing malicious code.
Java. Lang. Object Class.

 

There are several important concepts that need to be understood. (Security-related)

1. namespace
Each class loader has its own namespace, which consists of the loader and all the classes loaded by the parent loader.
In the same namespace, two classes with the same full name (including the package name of the class) are not displayed. In different namespaces,
There may be two classes with the same full name (including the package name of the class.

2. runtime package
A runtime package consists of classes loaded by the same class loader that belong to the same package. Determines whether the two classes belong to the same runtime package, not only
It depends on whether the package names are the same and whether the class loaders are the same. Only the classes that belong to the same runtime package can access and be visible to each other (that is, the default access level)
. This restriction prevents custom classes from impersonating the class of the core class library and accessing the visible members of the core class library. Assume that you have defined a class
Java. lang. spy, which is loaded by the user-defined class loader due to Jang. lang. spy and core class library Java. lang. * loaded by different loaders, which belong to different runtime packages, so Java. lang. spy cannot access the core class library Java. visible member in the lang package.

Related Article

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.