Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-1432

ClassCastException when JBoss LogManager is initialized before the logging subsystem expects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 9.0.0.Final
    • Component/s: Logging
    • Labels:
      None

      Description

      When making the following modifications to put JBoss LogManager on the boot classpath to make it available to Java agents:

      diff --git a/bin/standalone.conf b/bin/standalone.conf
      index 97895a5..9517129 100644
      --- a/bin/standalone.conf
      +++ b/bin/standalone.conf
       -35,7 +35,7 @@
       #JAVA=""
       
       if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
      -   JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"
      +   JBOSS_MODULES_SYSTEM_PKGS="org.jboss.logmanager,org.jboss.logmanager.config,org.jboss.logmanager.errormanager,org.jboss.logmanager.filters,org.jboss.logmanager.formatters,org.jboss.logmanager.handlers"
       fi
       
       # Uncomment the following line to prevent manipulation of JVM options
       -48,7 +48,7 @@ fi
       #
       if [ "$JAVA_OPTS" = "x" ]; then
          JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
      -   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
      +   JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.4.0.Final-redhat-1.jar -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true -Dcom.sun.management.jmxremote=x -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
       else
          echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
       fi
      

      I get the following error:

      09:28:18,984 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 5) JBAS014612: Operation ("add") failed - address: ([
          ("subsystem" => "logging"),
          ("console-handler" => "CONSOLE")
      ]): java.lang.ClassCastException: org.jboss.logmanager.PropertyConfigurator cannot be cast to org.jboss.as.logging.logmanager.ConfigurationPersistence
              at org.jboss.as.logging.logmanager.ConfigurationPersistence.getOrCreateConfigurationPersistence(ConfigurationPersistence.java:93)
              at org.jboss.as.logging.logmanager.ConfigurationPersistence.getOrCreateConfigurationPersistence(ConfigurationPersistence.java:81)
              at org.jboss.as.logging.LoggingOperations$LoggingOperationStepHandler.execute(LoggingOperations.java:154)
              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440) [jboss-as-controller-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322) [jboss-as-controller-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229) [jboss-as-controller-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224) [jboss-as-controller-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:334) [jboss-as-controller-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_45]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_45]
              at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_45]
              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]
      

        Attachments

          Activity

            People

            Assignee:
            jamezp James Perkins
            Reporter:
            klape Kyle Lape
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: