0 Replies Latest reply on Jan 15, 2014 11:47 PM by anishantony

    LogManager Exception in JBOSS AS 7.1 with java.util.Logger

    anishantony

      I created a java application and initialize a java.util.Logger with that application and deployed it into jboss as7.1 (GateIn embedded jboss) and i got IllegalStateException (i am using eclipse IDE).Here follows my logger initialization code. Here follows my logger initialization code

       

      static public void setup() throws IOException {

       

        // Get the global logger to configure it

        Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);

       

        logger.setLevel(Level.INFO);

        fileTxt = new FileHandler("C:/Users/abc/Desktop/BMITAGENT/Logging.txt");

        fileHTML = new FileHandler("C:/Users/abc/Desktop/BMITAGENT/Logging.html");

       

        // create txt Formatter

        formatterTxt = new SimpleFormatter();

        fileTxt.setFormatter(formatterTxt);

        logger.addHandler(fileTxt);

       

        // create HTML Formatter

        formatterHTML = new BMITHtmlFormatter();

        fileHTML.setFormatter(formatterHTML);

        logger.addHandler(fileHTML);

        }

       

      And my exception is

       

      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:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        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.(BridgeRepositorySelector.java:42)

        ... 7 more

       

       

      And i serched in fourms and i got a solution which is Open the launch configuration for the server definition. and add -logmodule org.jboss.logmanager to the program arguments before org.jboss.as.standalone. But it results the same exception with some additional warning. Here follows the exception

       

      WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.

      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:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          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.(BridgeRepositorySelector.java:42)

          ... 7 more