Instruct Wildfly to run an application as a modular application (Java 9 modules)

184 views
Skip to first unread message

Marcos Antonio Pereira Silva

unread,
Feb 14, 2021, 11:07:52 AM2/14/21
to WildFly
I'm using
  • Wildfly 21
  • Java 11
I've just went through the pain of modularizing (with Java 9 modules) an Jakarta EE EAR application of mine that runs on Wildfly 21. This application has a war jar, ejb jars, utility jars (all have a module-info.java now) and other third party libraries. The whole application compiles well, without errors.

But I noticed that when I run it in Wildfly, althought it runs without problems as before when it wasn't modular, it seems that the application server is not considering that it is now a modular application and is not using the modulepath to run the application, but the classpath. So, at runtime, the modular nature of the application is being ignored.

Is there a way to instruct the application server to run the application as a modular one, using the modulepath instead of the classpath?

Brian Stansberry

unread,
Feb 14, 2021, 11:14:27 AM2/14/21
to WildFly
Sorry, no there is not. WildFly runs in classpath mode.

We support modularization using JBoss Modules; i.e. you can add JBoss Modules modules to the $WILDFLY_HOME/modules dir and have your deployments depend on those, but that's not JPMS.

Marcos Antonio Pereira Silva

unread,
Feb 14, 2021, 6:45:02 PM2/14/21
to WildFly
Is there any proposal to support this in the future? If so, do you already have any suggested date or Wildfly version?

Brian Stansberry

unread,
Feb 15, 2021, 2:22:19 PM2/15/21
to WildFly
Moving off of using classpath mode is not currently on our roadmap.

As the Jakarta EE specs begin to move beyond requiring SE 8 looking into this starts to become more interesting (to me at least) but it's a big change and not one likely to happen soon.

Reply all
Reply to author
Forward
0 new messages