1

我们将 Wildfly 15 与 JMX Exporter 一起使用。启动 WildFly 服务器时,我得到以下异常,并且我的想法已经不多了。该软件包存在于modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.4.0.Final.jar.

=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: /opt/jboss/wildfly-15.0.1.Final
  JAVA: /opt/java/jdk1.8.0_201/bin/java
  JAVA_OPTS:  -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.5.Final.jar -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-1.1.6.Final.jar -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/slf4j/impl/main/slf4j-jboss-logmanager-1.0.3.GA.jar -javaagent:/opt/jboss/wildfly-15.0.1.Final/prometheus/jmx-prometheus.jar=9404:/opt/jboss/wildfly-15.0.1.Final/prometheus/config.yaml -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -server -Xmx3G -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n 
=========================================================================
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Listening for transport dt_socket at address: 8787
java.lang.NoClassDefFoundError: org/wildfly/common/net/HostName
    at org.jboss.logmanager.ExtLogRecord.<init>(ExtLogRecord.java:87)
    at org.jboss.logmanager.Logger.log(Logger.java:796)
    at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
    at org.jboss.logging.Logger.logf(Logger.java:2398)
    at org.jboss.msc.service.ServiceLogger_$logger.greeting(ServiceLogger_$logger.java:40)
    at org.jboss.msc.service.ServiceContainerImpl.<clinit>(ServiceContainerImpl.java:91)
    at org.jboss.msc.service.ServiceContainer$Factory.create(ServiceContainer.java:250)
    at org.jboss.as.server.BootstrapImpl$ShutdownHook.register(BootstrapImpl.java:231)
    at org.jboss.as.server.BootstrapImpl$ShutdownHook.access$100(BootstrapImpl.java:221)
    at org.jboss.as.server.BootstrapImpl.<init>(BootstrapImpl.java:72)
    at org.jboss.as.server.Bootstrap$Factory.newInstance(Bootstrap.java:278)
    at org.jboss.as.server.Main.main(Main.java:106)
    at org.jboss.modules.Module.run(Module.java:352)
    at org.jboss.modules.Module.run(Module.java:320)
    at org.jboss.modules.Main.main(Main.java:593)
4

1 回答 1

3

我终于设法通过设置以下内容使其运行JAVA_OPTS

-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager
# We need to add this JAR explicitly to avoid a NoClassDefFoundError.
-Xbootclasspath/p:${JBOSS_HOME}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.4.0.Final.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.5.Final.jar
-javaagent:${JBOSS_HOME}/prometheus/jmx-prometheus.jar=9404:${JBOSS_HOME}/prometheus/config.yaml"

请记住根据您的设置调整版本。

于 2019-04-27T20:26:49.570 回答