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.