作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 GarbageCollectionNotificationInfo 订阅 GC 通知。通知有效,但当我尝试在 Wildfly 8.2 中使用此机制时,我收到 java.lang.NoClassDefFoundError
:
java.lang.NoClassDefFoundError: com/sun/management/GarbageCollectionNotificationInfo
2017-02-06 08:40:09,156 ERROR [stderr] (Service Thread) at com.vonage.metrics.GCNotificationListener.handleNotification(GCNotificationListener.java:28)
2017-02-06 08:40:09,156 ERROR [stderr] (Service Thread) at sun.management.NotificationEmitterSupport.sendNotification(NotificationEmitterSupport.java:156)
2017-02-06 08:40:09,157 ERROR [stderr] (Service Thread) at sun.management.GarbageCollectorImpl.createGCNotification(GarbageCollectorImpl.java:147)
我发现在某些情况下你需要在 Jboss/Wildfly 中包含依赖项:https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly
我需要以某种方式包含 com.sun.* 包吗?
最佳答案
我最近遇到了同样的问题,只是使用 WildFly 10.1.0.Final
。
解决方案是在 jboss-deployment-struction.xml
中使用类似的内容显式包含 com.sun.management
类:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<system>
<paths>
<path name="com/sun/management"/>
</paths>
</system>
</dependencies>
</deployment>
</jboss-deployment-structure>
关于java - GarbageCollectionNotificationInfo 使用 Wildfly 8 导致 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42066835/
我正在尝试使用 GarbageCollectionNotificationInfo 订阅 GC 通知。通知有效,但当我尝试在 Wildfly 8.2 中使用此机制时,我收到 java.lang.NoC
我是一名优秀的程序员,十分优秀!