How to debug module loading in WildFly
In this tutorial you will learn how to debug the list of WildFly modules loaded at boot. In order to do that, you need to increase the level of logging on the namespace “org.jboss.modules” so that it will log information about a particular class being loaded and the module from which it comes.
/subsystem=logging/logger=org.jboss.modules:add(level=TRACE)
Now if you check the server.log file you will see that, every class found in the modules will be printed. Here is a small excerpt of the logs:
2018-12-11 19:09:55,439 TRACE [org.jboss.modules] (management-handler-thread - 1) Finding class java.util.LinkedHashSet from Module "org.jboss.as.logging" version 6.0.2.Final from local module loader @3fb6a447 (finder: local module finder @79b4d0f (roots: /home/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules,/home/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules/system/layers/base))
2018-12-11 19:09:55,444 TRACE [org.jboss.modules] (management-handler-thread - 1) Finding class org.jboss.as.controller.persistence.ConfigurationFilePersistenceResource from Module "org.jboss.as.controller" version 6.0.2.Final from local module loader @3fb6a447 (finder: local module finder @79b4d0f (roots: /home/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules,/home/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules/system/layers/base))
2018-12-11 19:09:55,445 TRACE [org.jboss.modules] (management-handler-thread - 1) Finding local class org.jboss.as.controller.persistence.ConfigurationFilePersistenceResource from Module "org.jboss.as.controller" version 6.0.2.Final from local module loader @3fb6a447 (finder: local module finder @79b4d0f (roots: /home/francesco/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules,/home/jboss/wildfly-15.0.0.Alpha1-SNAPSHOT/modules/system/layers/base))
If you are running in Domain mode, just prepend the profile at the beginning:
/profile=full/subsystem=logging/logger=org.jboss.modules:add(level=TRACE)
Restart the server for the changes to take effect.
Recommended Articles
Advanced Configuration of jboss-deployment-structure.xml for Enhanced Java Applications on WildFly
Learn how to configure jboss-deployment-structure.xml for fine-tuning module dependencies in WildFly applications. #WildFly #Java #Middleware #CloudNative
Enhance Your Enterprise Java Applications with JBoss EAP/WildFly Classloading Strategies
Optimize your enterprise applications with JBoss EAP/WildFly's advanced classloading strategies for seamless utility library management and versioning.
Develop and Deploy Message Driven Beans on WildFly Application Server - A Comprehensive Guide
Learn how to develop and deploy MDBs on WildFly. Includes configuration, development, deployment steps & example code.
Emulate Application Versioning on JBoss EAP/WildFly: A Simple Tutorial
Learn how to manage application versions with JBoss EAP/WildFly. Track changes, collaborate, and distribute software releases effectively.