本文介绍了jboss无法加载logmanager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在JBoss AS 7.1.1 Final"Brontes"上启用JMX.Sofar我在jboss/bin中编辑了startup.conf文件,以容纳以下几行:

I'm trying to enable JMX on a JBoss AS 7.1.1 Final "Brontes".Sofar I edited the startup.conf in jboss/bin to hold these following lines:

# Enable JMX Remote
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9999"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

然后在启动jboss时出现以下错误消息:

then on starting the jboss I got following error message:

> 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:278)
>         at org.jboss.modules.Module.run(Module.java:247)
>         at org.jboss.modules.Main.main(Main.java:291) Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Level
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>         at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:395)
>         at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
>         ... 4 more

然后我在standalone.conf中添加了以下几行

Then I added following lines to the standalone.conf

JBOSS_MODULES_SYSTEM_PKGS="org.jboss.logmanager"

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
    JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar"

但仍然出现错误

Could not load Logmanager "org.jboss.logmanager.LogManager"
java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.util.logging.LogManager$1.run(LogManager.java:191)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.<clinit>(LogManager.java:181)
        at java.util.logging.Logger.demandLogger(Logger.java:339)
        at java.util.logging.Logger.getLogger(Logger.java:393)
        at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
        at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:846)
        at sun.management.Agent.startAgent(Agent.java:260)
        at sun.management.Agent.startAgent(Agent.java:450)
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.jboss.as.server.Main.main(Main.java:73)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.jboss.modules.Module.run(Module.java:260)
        at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
        at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
        at org.jboss.logmanager.log4j.BridgeRepositorySelector.<clinit>(BridgeRepositorySelector.java:42)
        ... 7 more

现在我不知道下一步该怎么做.我也没有在Google上找到任何东西.有人可以帮我吗?

Now I'm out of ideas what to do next. I haven't found anything on google either. Can someone help me please?

推荐答案

对于Wildly 14,您必须将Wildfly Commons和Logmanager添加到类路径中,因此JAVA_OPTS如下所示

For Wildly 14 you have to add Wildfly Commons and the Logmanager to the class path, hence the JAVA_OPTS looks like the following

-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Xbootclasspath/p:/opt/jboss/wildfly/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.4.Final.jar
-Xbootclasspath/p:/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.4.0.Final.jar
-Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=127.0.0.1
-Dcom.sun.management.jmxremote.port=10001
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false -Xms2g -Xmx2g -Xss512k
-XX:SurvivorRatio=2 -Dsun.net.inetaddr.ttl=300 -Djava.net.preferIPv4Stack=true
-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n

这篇关于jboss无法加载logmanager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 07:40