0

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?

It's a pity that we have to be locked by application servers like Wildfly blocking us from using such an important Java feature (modules) at runtime in our applications.

Marcos
  • 1,237
  • 1
  • 15
  • 31
  • This is duplicate of https://stackoverflow.com/questions/46497172/is-java-9-modularity-for-war-files-as-well/46907106#46907106 – Tomaz Cerar Feb 16 '21 at 10:49
  • 1
    @TomazCerar Thanks for the reference. There's something similar here too: https://stackoverflow.com/questions/58737469/does-java-ee-jakarta-ee-support-the-java-module-system-is-it-possible-to-make . I also got an official answer from the Wildfly guys: https://groups.google.com/g/wildfly/c/lTj1suvUpYg – Marcos Feb 16 '21 at 12:47

1 Answers1

0

While Wildfly doesn't support running modular wars, you can take a look at Piranha Cloud.

The Piranha Server itself can run in the module path and can deploy WARs in a new JPMS layer, respecting the module-info.class provided.

https://piranha.cloud/blog/2021/20210128_Modular_applications_with_JPMS

PS: I'm a Piranha Cloud developer