]
James Perkins commented on WFCORE-3797:
---------------------------------------
It looks like the IBM implementation of the
{{java.lang.management.ManagementFactory.getRuntimeMXBean()}} instantiates a logger via
the {{NotificationBroadcasterSupport}} in the
{{com.ibm.lang.management.internal.ExtendedRuntimeMXBeanImpl}} implementation. This causes
the log manager to be accessed before the system property is set. The
{{org.apache.maven.surefire.booter.ForkedBooter}} is what invokes the
{{ManagementFactory.getRuntimeMXBean()}}.
The workaround would be to put set the property on the surefire {{<argLine/>}} as
well as add the jboss-logmanager to the boot class path. This does seem to produce an odd
message indicating:
{code}
[WARNING] ForkStarter IOException: 132 INFO [org.jboss.msc] JBoss MSC version
1.4.2.Final
173 INFO [org.jboss.threads] JBoss Threads version 2.3.2.Final. See the dump file
/home/jperkins/projects/jboss/wildfly/wildfly-core/logging/target/surefire-reports/2018-07-31T15-47-10_865-jvmRun1.dumpstream
{code}
The file contains:
{code}
ForkStarter IOException: 849 INFO [org.jboss.msc] JBoss MSC version 1.4.2.Final
890 INFO [org.jboss.threads] JBoss Threads version 2.3.2.Final.
org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: 849 INFO
[org.jboss.msc] JBoss MSC version 1.4.2.Final
890 INFO [org.jboss.threads] JBoss Threads version 2.3.2.Final
at
org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.<init>(ThreadedStreamConsumer.java:58)
at
org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.<init>(ThreadedStreamConsumer.java:110)
at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:596)
at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1194)
at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1022)
at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:868)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
{code}
This still seems to report success and failures correctly so it seems the workaround
should be suitable.
Logging Subsystem test failures on IBM jdk
------------------------------------------
Key: WFCORE-3797
URL:
https://issues.jboss.org/browse/WFCORE-3797
Project: WildFly Core
Issue Type: Bug
Components: Logging, Test Suite
Affects Versions: 5.0.0.Alpha1, 5.0.0.Alpha2, 5.0.0.Alpha3, 5.0.0.Alpha4
Environment: {noformat}
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: /usr/lib/maven
Java version: 1.8.0_161, vendor: IBM Corporation
Java home: /usr/lib/java/ibm-java-8.0-5.11/jre
{noformat}
Reporter: Petr Kremensky
Assignee: James Perkins
WildFly: Logging Subsystem unit tests fails on IBM jdk with:
{noformat}
java.lang.IllegalStateException: WFLYLOG0078: 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"
at org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:168)
at
org.jboss.as.subsystem.test.TestModelControllerService.preBoot(TestModelControllerService.java:158)
at
org.jboss.as.model.test.ModelTestModelControllerService.boot(ModelTestModelControllerService.java:264)
at
org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:419)
at
org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:372)
at java.lang.Thread.run(Thread.java:811)
{noformat}
The test works fine with *4.0.0.Final*, starts failing in *5.0.0.Alpha1*.
This doens't look like a functional issue to me as I was able to workaround the issue
by either running the test with the older surefire instance (
-Dversion.surefire.plugin=2.19 is the last working ) or by extending
{{surefire.system.args}} in pom.xml with
{{-Djava.util.logging.manager=org.jboss.logmanager.LogManager}}. The other however
produces the following warnings upon test execution
{noformat}
...
[WARNING] The system property java.util.logging.manager is configured twice! The property
appears in <argLine/> and any of <systemPropertyVariables/>,
<systemProperties/> or user property.
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.jboss.as.logging.HandlerLegacyOperationsTestCase
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ
web page and the dump file
/home/pkremens/devel/wildfly-core/logging/target/surefire-reports/2018-05-03T13-49-32_779-jvmRun1.dumpstream
...
{noformat}