简体   繁体   English

为什么不同自定义类加载器加载的类不能互相调用

[英]Why the classes loaded by different custom classloaders can't invoke each other

为什么它们彼此隔离并且只能使用它们自己和它们的父母加载的类,尽管它们都存储在共享的方法区中

Classes loaded in different branches of a class loader tree cannot call each other directly as they don't have access to the classes or interfaces in branches they don't have.在类加载器树的不同分支中加载的类不能直接相互调用,因为它们无权访问它们没有的分支中的类或接口。 What they can do is use reflection, or call via a common interface or superclass.他们可以做的是使用反射,或者通过公共接口或超类进行调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Spring Boot和Logback中由不同的Classloader加载的类 - Classes loaded by different Classloaders in Spring Boot and Logback 在同一个Dalvik / JVM中使用不同类加载器实例化的类不能相互“看到” - Classes instantiated with different classloaders in the same Dalvik/JVM cannot “see” each other 从不同ClassLoader加载的类访问静态方法 - Access static method from classes loaded by different ClassLoaders 检测不同ClassLoader加载的类的Class对象等效性 - Detecting Class object equivalence for classes loaded by different ClassLoaders Spring Data,EclipseLink和SimpleLoadTimeWeaver; 由不同的ClassLoader加载的域类 - Spring Data, EclipseLink, and SimpleLoadTimeWeaver; domain classes loaded by different ClassLoaders 为什么同一包中的类无法自动相互看见? - Why can't classes in the same package see each other automagically? 为什么不允许未签名的applet创建自定义ClassLoaders? - Why aren't unsigned applets allowed to create custom ClassLoaders? 更改对不同类加载器加载的单例类的影响 - Impact of changes on singleton class loaded by different classloaders Java类位于同一包(不同的目录)中,但它们不能彼此访问 - Java classes are in the same package (different directories) but they can't access each other 无法从tomcat中自定义类加载器加载的类中获取注释 - Can't get annotations from classes loaded by custom classloader in tomcat
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM