Which app-servers support multi-release JARs in WARs (if any)?
Since Java 9 there are Multi-Release JARs (MRJARS) that allow different classes for different Java versions to be included in one JAR file. I was surprised when a Wildfly 14 running on Java 11 executed Java-8-code in a JAR included in a WAR although the JAR was a MRJAR with code for Java 11. That JAR included as a dependency for a regular Java SE project is running different code depending on the running JRE, but when included in a WAR, the Java-11-code seems to be ignored.
Is that expected behavior for a webserver, as Java EE 8 does not explicitly require Java 9 (which introduced MRJARs) but only Java 8? Are there other webservers that do correctly read the MRJARs when run on a newer Java version? Or are MRJARs just a feature for Java SE?
If I understand the Wildfly documentation correctly, all contents of a WAR a loaded by the same class loader (org.jboss.modules.ModuleClassLoader according to my debugger), so maybe that classloader does not correclty read the included JARs?
java wildfly war java-9 java-ee-8
add a comment |
Since Java 9 there are Multi-Release JARs (MRJARS) that allow different classes for different Java versions to be included in one JAR file. I was surprised when a Wildfly 14 running on Java 11 executed Java-8-code in a JAR included in a WAR although the JAR was a MRJAR with code for Java 11. That JAR included as a dependency for a regular Java SE project is running different code depending on the running JRE, but when included in a WAR, the Java-11-code seems to be ignored.
Is that expected behavior for a webserver, as Java EE 8 does not explicitly require Java 9 (which introduced MRJARs) but only Java 8? Are there other webservers that do correctly read the MRJARs when run on a newer Java version? Or are MRJARs just a feature for Java SE?
If I understand the Wildfly documentation correctly, all contents of a WAR a loaded by the same class loader (org.jboss.modules.ModuleClassLoader according to my debugger), so maybe that classloader does not correclty read the included JARs?
java wildfly war java-9 java-ee-8
1
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
1
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
1
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
1
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03
add a comment |
Since Java 9 there are Multi-Release JARs (MRJARS) that allow different classes for different Java versions to be included in one JAR file. I was surprised when a Wildfly 14 running on Java 11 executed Java-8-code in a JAR included in a WAR although the JAR was a MRJAR with code for Java 11. That JAR included as a dependency for a regular Java SE project is running different code depending on the running JRE, but when included in a WAR, the Java-11-code seems to be ignored.
Is that expected behavior for a webserver, as Java EE 8 does not explicitly require Java 9 (which introduced MRJARs) but only Java 8? Are there other webservers that do correctly read the MRJARs when run on a newer Java version? Or are MRJARs just a feature for Java SE?
If I understand the Wildfly documentation correctly, all contents of a WAR a loaded by the same class loader (org.jboss.modules.ModuleClassLoader according to my debugger), so maybe that classloader does not correclty read the included JARs?
java wildfly war java-9 java-ee-8
Since Java 9 there are Multi-Release JARs (MRJARS) that allow different classes for different Java versions to be included in one JAR file. I was surprised when a Wildfly 14 running on Java 11 executed Java-8-code in a JAR included in a WAR although the JAR was a MRJAR with code for Java 11. That JAR included as a dependency for a regular Java SE project is running different code depending on the running JRE, but when included in a WAR, the Java-11-code seems to be ignored.
Is that expected behavior for a webserver, as Java EE 8 does not explicitly require Java 9 (which introduced MRJARs) but only Java 8? Are there other webservers that do correctly read the MRJARs when run on a newer Java version? Or are MRJARs just a feature for Java SE?
If I understand the Wildfly documentation correctly, all contents of a WAR a loaded by the same class loader (org.jboss.modules.ModuleClassLoader according to my debugger), so maybe that classloader does not correclty read the included JARs?
java wildfly war java-9 java-ee-8
java wildfly war java-9 java-ee-8
edited Nov 14 '18 at 13:57
hd42
asked Nov 14 '18 at 12:59
hd42hd42
1,1751218
1,1751218
1
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
1
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
1
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
1
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03
add a comment |
1
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
1
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
1
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
1
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03
1
1
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
1
1
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
1
1
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
1
1
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03
add a comment |
1 Answer
1
active
oldest
votes
Well, my Bug report lead to a fix so now Wildfly does support MRJARs in deployed WARs :)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300848%2fwhich-app-servers-support-multi-release-jars-in-wars-if-any%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well, my Bug report lead to a fix so now Wildfly does support MRJARs in deployed WARs :)
add a comment |
Well, my Bug report lead to a fix so now Wildfly does support MRJARs in deployed WARs :)
add a comment |
Well, my Bug report lead to a fix so now Wildfly does support MRJARs in deployed WARs :)
Well, my Bug report lead to a fix so now Wildfly does support MRJARs in deployed WARs :)
answered Feb 8 at 16:28
hd42hd42
1,1751218
1,1751218
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300848%2fwhich-app-servers-support-multi-release-jars-in-wars-if-any%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Running with -Djdk.util.jar.enableMultiRelease=force might be useful for your testing.
– Alan Bateman
Nov 14 '18 at 13:39
1
That argument does not seem to have any influence on my wildfly, @AlanBateman.
– hd42
Nov 14 '18 at 13:52
1
This would work for installed modules, but it doesn't look like it works for libraries in a WAR. It could have to do with the WAR not having the MR JAR spec. Feel free to file an issue at issues.jboss.org/browse/WFLY though.
– James R. Perkins
Nov 15 '18 at 3:56
1
To clarify a bit I think it has to do with libraries being loaded in the same CL as the WAR.
– James R. Perkins
Nov 15 '18 at 3:57
I opened issues.jboss.org/browse/WFLY-11353, @JamesR.Perkins
– hd42
Nov 15 '18 at 8:03