You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Nathan Reynolds (JIRA)" <ji...@apache.org> on 2018/11/21 16:20:00 UTC
[jira] [Updated] (LOG4J2-2513) NPE in
RollingRandomAccessFileManager.RollingRandomAccessFileManagerFactory.createManger()
[ https://issues.apache.org/jira/browse/LOG4J2-2513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Reynolds updated LOG4J2-2513:
------------------------------------
Description:
RollingRandomAccessFileManager.RollingRandomAccessFileManagerFactory.createManger() throws a NullPointerException because file is null in the following code.
{quote}if (rrm.isAttributeViewEnabled()) \{
rrm.defineAttributeView(file.toPath());
\}{quote}
I think the following XML configuration can reproduce the problem.
{quote}<RollingRandomAccessFile ... filePermissions="rw-------">
<DirectWriteRolloverStrategy/>
...
</RollingRandomAccessFile>
{quote}
If I remove filePermissions from the configuration, then rrm.isAttributeViewEnabled() returns false and the NullPointerException is avoided. I tried adding fileName to RollingRandomAccessFile but this is illegal. If this were allowed, then file would be initialized earlier in the method.
was:
RollingRandomAccessFileManager.RollingRandomAccessFileManagerFactory.createManger() throws a NullPointerException because file is null in the following code.
{quote}if (rrm.isAttributeViewEnabled()) {
rrm.defineAttributeView(file.toPath());
}
{quote}
I think the following XML configuration can reproduce the problem.
{quote}<RollingRandomAccessFile ... filePermissions="rw-------">
<DirectWriteRolloverStrategy/>
...
</RollingRandomAccessFile>
{quote}
If I remove filePermissions from the configuration, then rrm.isAttributeViewEnabled() returns false and the NullPointerException is avoided. I tried adding fileName to RollingRandomAccessFile but this is illegal. If this were allowed, then file would be initialized earlier in the method.
> NPE in RollingRandomAccessFileManager.RollingRandomAccessFileManagerFactory.createManger()
> ------------------------------------------------------------------------------------------
>
> Key: LOG4J2-2513
> URL: https://issues.apache.org/jira/browse/LOG4J2-2513
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.11.1
> Reporter: Nathan Reynolds
> Priority: Major
>
> RollingRandomAccessFileManager.RollingRandomAccessFileManagerFactory.createManger() throws a NullPointerException because file is null in the following code.
> {quote}if (rrm.isAttributeViewEnabled()) \{
> rrm.defineAttributeView(file.toPath());
> \}{quote}
> I think the following XML configuration can reproduce the problem.
> {quote}<RollingRandomAccessFile ... filePermissions="rw-------">
> <DirectWriteRolloverStrategy/>
> ...
> </RollingRandomAccessFile>
> {quote}
> If I remove filePermissions from the configuration, then rrm.isAttributeViewEnabled() returns false and the NullPointerException is avoided. I tried adding fileName to RollingRandomAccessFile but this is illegal. If this were allowed, then file would be initialized earlier in the method.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)