You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2018/04/17 21:45:44 UTC
logging-log4j2 git commit: [LOG4J2-548] Log4j 2.0 ERROR "Could not
search jar" with JBoss EAP 6.2.
Repository: logging-log4j2
Updated Branches:
refs/heads/release-2.x ce0395761 -> 35f4ed5f7
[LOG4J2-548] Log4j 2.0 ERROR "Could not search jar" with JBoss EAP 6.2.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/35f4ed5f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/35f4ed5f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/35f4ed5f
Branch: refs/heads/release-2.x
Commit: 35f4ed5f7817305a12d3badc311cce810324ecf9
Parents: ce03957
Author: Gary Gregory <ba...@hotmail.com>
Authored: Tue Apr 17 15:45:40 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Apr 17 15:45:40 2018 -0600
----------------------------------------------------------------------
.../core/config/plugins/util/ResolverUtil.java | 27 ++++++++++++++++----
src/changes/changes.xml | 3 +++
2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/35f4ed5f/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
index 29fe395..73b5fc0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.config.plugins.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -198,13 +199,29 @@ public class ResolverUtil {
close(stream, newURL);
}
} else if (VFS.equals(url.getProtocol())) {
- final String containerPath = urlPath.substring(1,
- urlPath.length() - packageName.length() - 2);
+ final String containerPath = urlPath.substring(1, urlPath.length() - packageName.length() - 2);
final File containerFile = new File(containerPath);
- if (containerFile.isDirectory()) {
- loadImplementationsInDirectory(test, packageName, new File(containerFile, packageName));
+ if (containerFile.exists()) {
+ if (containerFile.isDirectory()) {
+ loadImplementationsInDirectory(test, packageName, new File(containerFile, packageName));
+ } else {
+ loadImplementationsInJar(test, packageName, containerFile);
+ }
} else {
- loadImplementationsInJar(test, packageName, containerFile);
+ // fallback code for Jboss/Wildfly, if the file couldn't be found
+ // by loading the path as a file, try to read the jar as a stream
+ final String path = urlPath.substring(0, urlPath.length() - packageName.length() - 2);
+ final URL newURL = new URL(url.getProtocol(), url.getHost(), path);
+
+ try (final InputStream is = newURL.openStream()) {
+ final JarInputStream jarStream;
+ if (is instanceof JarInputStream) {
+ jarStream = (JarInputStream) is;
+ } else {
+ jarStream = new JarInputStream(is);
+ }
+ loadImplementationsInJar(test, packageName, path, jarStream);
+ }
}
} else if (BUNDLE_RESOURCE.equals(url.getProtocol())) {
loadImplementationsInBundle(test, packageName);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/35f4ed5f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 117d933..5c442e6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,6 +52,9 @@
<action issue="LOG4J2-2313" dev="ggregory" type="update">
Update LMAX Disruptor from 3.3.7 to 3.4.2.
</action>
+ <action issue="LOG4J2-548" dev="ggregory" type="update" due-to="Shehata, Paresh Varke, Eric Victorson, Martin Laforet">
+ Log4j 2.0 ERROR "Could not search jar" with JBoss EAP 6.2.
+ </action>
</release>
<release version="2.11.0" date="2018-03-11" description="GA Release 2.11.0">
<action issue="LOG4J2-2104" dev="rgoers" type="fix">