JBoss Issue with external Java Agent
Issue
When trying to start JBoss 6.x with the javaagent parameter in JAVA_OPTS, JBoss errors out and doesn’t start. This is a known bug with JBoss as documented by Redhat (article no: https://access.redhat.com/solutions/312453).
The following is the error message:
1log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).2log4j:WARN Please initialize the log4j system properly.3log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.4WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager5Sep 13, 2017 1:58:11 AM org.jboss.msc.service.ServiceContainerImpl <clinit>6INFO: JBoss MSC version 1.0.4.GA-redhat-17Sep 13, 2017 1:58:12 AM org.jboss.as.server.ApplicationServerService start8INFO: JBAS015899: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) starting9Sep 13, 2017 1:58:17 AM org.jboss.as.controller.AbstractOperationContext executeStep10ERROR: JBAS014612: Operation ("parallel-extension-add") failed - address: ([])11java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging12at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:99)13at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:607)14at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:485)15at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:282)16at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:277)17at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:269)18at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:291)19at org.jboss.as.server.ServerService.boot(ServerService.java:349)20at org.jboss.as.server.ServerService.boot(ServerService.java:324)21at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:253)22at java.lang.Thread.run(Thread.java:748)23Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"24at java.util.concurrent.FutureTask.report(FutureTask.java:122)25at java.util.concurrent.FutureTask.get(FutureTask.java:192)26at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:91)27... 10 more28Caused by: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"29at org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:110)30at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:97)31at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:127)32at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:113)33at java.util.concurrent.FutureTask.run(FutureTask.java:266)34at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)35at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)36at java.lang.Thread.run(Thread.java:748)37at org.jboss.threads.JBossThread.run(JBossThread.java:122)3839Sep 13, 2017 1:58:17 AM org.jboss.as.server.ServerService boot40**FATAL: JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.**
Version Applicable: JBoss 6.x
Work Around
Redhat has a documented work around for the same. To make it applicable for tcell, please complete the following steps:
Edit the standalone.sh file (vi standalone.sh)
Add the following entry:
1```2XXX=/opt/EAP-6.2.0/jboss-eap-6.23JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:${XXX}/modules/system/layers/base/org/jboss/logmanager/main/jboss\4-logmanager-1.5.1.Final-redhat-1.jar:${XXX}/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-1.5.1.Final-redhat-1.jar"5JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/tcell/tcellagent.jar"6JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"7```Please make sure the folder location for xxx is the install location for JBoss
Please make sure the jboss-logmanager-1.x.x.Final-redhat-1.jar location is adjusted.
At the command prompt, execute
export JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/tcell/tcellagent.jar"
Please make sure the location of the tcellagent is set accordingly (this is for testing purpose and can be adjusted to be part of another file once the testing is completed to suit the application needs)
Start JBoss.
The following should be the output and JBoss should have started successfully
bash
1root@ip-172-31-6-108:/opt/EAP-6.2.0/jboss-eap-6.2/bin# ./standalone.sh23JAVA_OPTS already set in environment; overriding default settings with values: -javaagent:/opt/tcell/tcellagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/EAP-6.2.0/jboss-eap-6.2/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.1.Final-redhat-1.jar:/opt/EAP-6.2.0/jboss-eap-6.2/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-1.5.1.Final-redhat-1.jar -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager45=========================================================================67JBoss Bootstrap Environment89JBOSS_HOME: /opt/EAP-6.2.0/jboss-eap-6.21011JAVA: java1213JAVA_OPTS: -server -XX:+UseCompressedOops -javaagent:/opt/tcell/tcellagent.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/EAP-6.2.0/jboss-eap-6.2/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.1.Final-redhat-1.jar:/opt/EAP-6.2.0/jboss-eap-6.2/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-1.5.1.Final-redhat-1.jar -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager1415=========================================================================1617log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).18log4j:WARN Please initialize the log4j system properly.19log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.2002:02:31,297 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final-redhat-22102:02:32,457 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-12202:02:33,182 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015899: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) starting2302:02:38,924 INFO [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.7.GA-redhat-12402:02:38,977 INFO [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.7.GA-redhat-12502:02:38,974 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)2602:02:39,031 INFO [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.18.GA-redhat-12702:02:39,368 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2]2802:02:39,376 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem2902:02:39,440 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.3002:02:39,441 INFO [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem3102:02:39,607 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activating WebServices Extension3202:02:39,626 INFO [org.jboss.as.security] (MSC service thread 1-3) JBAS013170: Current PicketBox version=4.0.19.SP2-redhat-13302:02:39,885 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service3402:02:40,030 INFO [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]3502:02:40,044 INFO [org.jboss.as.connector.logging] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.23.Final-redhat-1)3602:02:40,488 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)3702:02:42,692 INFO [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final-redhat-13802:02:42,866 INFO [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/127.0.0.1:80803902:02:42,920 INFO [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-/127.0.0.1:80804002:02:43,431 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]4102:02:44,746 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on 127.0.0.1:99994202:02:44,746 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on 127.0.0.1:44474302:02:44,761 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /opt/EAP-6.2.0/jboss-eap-6.2/standalone/deployments4402:02:45,071 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management4502:02:45,071 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:99904602:02:45,072 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) started in 15324ms - Started 129 of 186 services (56 services are passive or on-demand)