[
https://issues.apache.org/jira/browse/LOG4J2-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17106311#comment-17106311
]
ASF subversion and git services commented on LOG4J2-2844:
---------------------------------------------------------
Commit f14341935c9e537cd8a002e8f716e2413e1a2bf1 in logging-log4j2's branch
refs/heads/release-2.x from Gary Gregory
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=f143419 ]
[LOG4J2-2844] Null pointer exception when no network interfaces are
available.
Also fix POM version from "2.14.0--SNAPSHOT" to "2.14.0-SNAPSHOT".
> Null pointer exception when no network interfaces are available
> ---------------------------------------------------------------
>
> Key: LOG4J2-2844
> URL: https://issues.apache.org/jira/browse/LOG4J2-2844
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.13.2
> Reporter: Andrei Terentiev
> Priority: Major
>
> Hi,
> java.net.NetworkInterface.getNetworkInterfaces() returns null when no
> network interfaces are available (e.g. networking is disabled at the moment)
> - see
> https://docs.oracle.com/javase/7/docs/api/java/net/NetworkInterface.html#getNetworkInterfaces().
> Seems that the line 98 of org.apache.logging.log4j.core.util.NetUtils.java
> should have a null check.
> Here is a stack trace:
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at
> org.apache.logging.log4j.core.util.WatchManager.<init>(WatchManager.java:53)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:135)
> at
> org.apache.logging.log4j.core.config.NullConfiguration.<init>(NullConfiguration.java:32)
> at org.apache.logging.log4j.core.LoggerContext.<clinit>(LoggerContext.java:86)
> at
> org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.createContext(ClassLoaderContextSelector.java:229)
> at
> org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:203)
> at
> org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:128)
> at
> org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:115)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:148)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
> at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:602)
> at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:588)
> at App$1.<init>(App.java:36)
> Caused by: java.lang.NullPointerException
> at org.apache.logging.log4j.core.util.NetUtils.getMacAddress(NetUtils.java:98)
> at org.apache.logging.log4j.core.util.UuidUtil.<clinit>(UuidUtil.java:64)
> ... 18 more
--
This message was sent by Atlassian Jira
(v8.3.4#803005)