Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

Java Agent の使用時に "The LogManager was not properly installed" エラーが発生し、JBoss を初期化することができません

Solution Verified - Updated -

Issue

  • 以下のいずれかのシステムプロパティを使用していると、下記の IllegalStateException を取得します。
-Dcom.sun.management.jmxremote=x"
-Dcom.sun.management.jmxremote.ssl=false"
-Dcom.sun.management.jmxremote.authenticate=false" />  
  • JVM コマンドラインパラメータ -javaagent から Java エージェント (Wily Introscope など) をインストールしました。JBoss を起動すると、以下のエラーが発生します。
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:61)
    at org.jboss.as.server.Main.main(Main.java:84)
    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:601)
    at org.jboss.modules.Module.run(Module.java:270)
    at org.jboss.modules.Main.main(Main.java:294)

また、以下のような基本的な Java エージェントをお使いの場合に、このドキュメント1で提供されている解決策が必要となります。

package com.redhat.gss.agent;

import java.lang.instrument.Instrumentation;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;

import java.util.logging.Logger;
import java.util.logging.LogManager;

public class TestAgent implements java.lang.instrument.ClassFileTransformer
{
  private static Logger log = null;

  public
  byte[]
  transform(  ClassLoader         loader,
              String              className,
              Class<?>            classBeingRedefined,
              ProtectionDomain    protectionDomain,
              byte[]              classfileBuffer)
    throws IllegalClassFormatException
  {
    return null;
  }

  public static void premain(String arg, Instrumentation inst) throws Exception
  {
    System.out.println("TestAgent's classloader:" + TestAgent.class.getClassLoader());
    System.out.println("System classloader:      " + ClassLoader.getSystemClassLoader());
    System.out.println("Loaded class:" + Class.forName("org.jboss.logmanager.LogManager").getName());
    System.out.println("j.u.l.manager:" + System.getProperty("java.util.logging.manager"));
    log = Logger.getLogger(TestAgent.class.getName());
    log.info("GSS IS HERE:" + arg);
    log.info("Installed logmanager:" + LogManager.getLogManager().getClass().getName());
  }
}

  1. ソースは、http://bit.ly/UjXkN6 で利用できます。 

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.