gpt4 book ai didi

java - 无法加载 Logmanager "org.jboss.logmanager.LogManager"java.lang.ClassNotFoundException : org. jboss.logmanager.LogManager

转载 作者:行者123 更新时间:2023-11-30 06:39:51 34 4
gpt4 key购买 nike

我正在使用Visualvm工具并尝试通过jmx建立远程连接。我需要连接到我的远程服务器 ubuntu 14.04。我的 Web 应用程序在 Docker 上运行,jboss/wildfly 在 docker 上运行。下面是 dockerfile。

FROM jboss/wildfly:10.1.0.Final
RUN /opt/jboss/wildfly/bin/add-user.sh username password --silent
ENV JBOSS_LOG_MANAGER_LIB /opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar
ENV JAVA_OPTS="-XX:PermSize=4096m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses -Dcom.sun.management.jmxremote.rmi.port=8686 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8787 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=x.x.x.x -Xbootclasspath/p:$JBOSS_LOG_MANAGER_LIB -Djboss.modules.system.pkgs=org.jboss.logmanager -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA.jar -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar"
ADD project_web.war /home/ubuntu/SampleTest/project
ADD standalone.xml /opt/wildfly-8.2.0.Final/standalone/configuration
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
ENV OFFLINE_DB_USERNAME username
ENV OFFLINE_DB_URL jdbc:mysql://x.x.x.x:3306/%s?useLegacyDatetimeCode=false&useTimezone=true&serverTimezone=UTC
ENV OFFLINE_DB_SERVER_URL jdbc:mysql://x.x.x.x:3306/offlineserver?useLegacyDatetimeCode=false&useTimezone=true&serverTimezone=UTC
ENV OFFLINE_DB_PASSWORD password
EXPOSE 8787

我的运行命令是-

sudo docker run -e JAVA_OPTS="-Dlog4j.configurationFile=log4j2_dev.xml -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8787 -Dcom.sun.management.jmxremote.rmi.port=8686 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=x.x.x.x -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar -Djboss.modules.system.pkgs=org.jboss.logmanager -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA.jar -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar" -p 9595:8080 -p 9696:8080 -p 8787:8787 -v /home/ubuntu/SampleTest/project/logs:/opt/wildfly/standalone/log --restart=always -d sample/testweb:20170615

通过执行 docker log 和容器 ID,我收到以下错误 -

WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logmanager/Level
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.jboss.modules.Module.run(Module.java:320)
at org.jboss.modules.Main.main(Main.java:505)
Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:348)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
... 4 more

最佳答案

您只能指定-Xbootclasspath一次。我的猜测是它会选择最后一个实例并忽略其他实例。您需要将它们组合成一个参数。它可能应该看起来像:

-Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA.jar:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar

关于java - 无法加载 Logmanager "org.jboss.logmanager.LogManager"java.lang.ClassNotFoundException : org. jboss.logmanager.LogManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44560815/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com