[wildfly-dev] Equivalent to-Xbootclasspath/p:jboss-logmanager-2.0.7.Final.jar in Java 9

Fabian Stäber fabian at fstab.de
Wed Sep 27 10:07:50 EDT 2017


Hello,

I am sorry, but I still don't get it.

My agent initializes the java.util.logging.manager (indirectly, because it registers a JMX bean, and platform MBean server has an internal dependency to logging). This is done before any Wildfly code is loaded.

I understand that this works with Wildfly only if the agent uses org.jboss.logmanager.LogManager as the log manager implementation. With Java 8, this can be done with the following start script:

	cd ./wildfly-10.1.0.Final
	LOGMANAGER_JAR=$(find $(pwd) -name 'jboss-logmanager-*.jar')
	export JAVA_OPTS="
	    -Xbootclasspath/p:${LOGMANAGER_JAR}
	    -Djboss.modules.system.pkgs=org.jboss.logmanager,io.promagent.agent
	    -Djava.util.logging.manager=org.jboss.logmanager.LogManager
	    -javaagent:promagent.jar=port=9300
	"
	./bin/standalone.sh

The question is, how do I make jboss-logmanager-2.0.7.Final.jar available to the agent's class loader with Java 9? The "-Xbootclasspath/p:" option was removed, but the agent needs access to the org.jboss.logmanager.LogManager class to initialize logging correctly (Wildfly doesn't seem to run when the agent initializes logging with the default log manager).

Thanks for your help
Fabian

On Wed, Sep 27, 2017 at 11:45:12AM +0200, Tomaž Cerar wrote:
> Hey, 
> Keep in mind that while WildFly 11 does run fine on JDK9.
> It still does that in »classpath« mode not in pure modular(jigsaw) fashion.
> 
> As such –patch-module for WildFly modules (jboss-modules) does not apply (yet)
> 
> You should be fine by just using your agent with jboss-modules on CP and system property that James suggested.
> 
> --
> Tomaz
> 
> From: James Perkins
> Sent: sreda, 27. september 2017 02:45
> To: Fabian Stäber
> Cc: wildfly-dev at lists.jboss.org
> Subject: Re: [wildfly-dev] Equivalent to-Xbootclasspath/p:jboss-logmanager-2.0.7.Final.jar in Java 9
> 
> There is a system property you need to add to the JAVA_OPTS IIRC. Try adding "-Dsun.util.logging.disableCallerCheck=true". This should avoid the weird issues with the log manager.
> 
> On Tue, Sep 26, 2017 at 2:18 PM, Fabian Stäber <fabian at fstab.de> wrote:
> Hello,
> 
> sorry if this is the wrong place to ask, but I am trying to run a Java agent with Wildfly 11 and Java 9. In previous Java versions, I had to add -Xbootclasspath/p:jboss-logmanager-2.0.7.Final.jar to JAVA_OPTS to make sure the Wildfly java.util.logging.manager implementation is available to the agent.
> 
> I understand that in Java 9 the -Xbootclasspath/p option is replaced with the --patch-module option. However, I am having trouble to figure out how to use this option.
> 
> What is the equivalent to -Xbootclasspath/p:jboss-logmanager-2.0.7.Final.jar is in Java 9 with Wildfly 11?
> 
> Thanks a lot
> Fabian
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
> 
> 
> 
> 
> -- 
> James R. Perkins
> JBoss by Red Hat
> 


More information about the wildfly-dev mailing list