如何解决JMX和其他类加载器
我的项目是多模块的,其结构如下:
问题是插件部分使用与代理不同的类加载器。这样我就收到了
java.lang.classCastException: class com.github.lppedd.jmx.FeaturesMBean$Feature cannot be cast to class com.github.lppedd.jmx.FeaturesMBean$Feature
(com.github.lppedd.jmx.FeaturesMBean$Feature is in unnamed module of loader 'app';
com.github.lppedd.jmx.FeaturesMBean$Feature is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @35962a94)
隐含的MBean是
public interface FeaturesMBean {
List<Feature> availableFeatures();
class Feature implements Serializable {
private static final long serialVersionUID = 1L;
public final String name;
public final String description;
public Feature(final String name,final String description) {
this.name = name;
this.description = description;
}
}
}
我应该如何处理这个问题?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。