[ 
https://issues.apache.org/jira/browse/LOG4J2-2816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17955663#comment-17955663
 ] 

Jan Vermeulen commented on LOG4J2-2816:
---------------------------------------

This is NOT a comment on this issue. I actually want to report a new issue on 
the LOG4J2 project, but the project does not appear (at least to me) in the 
list of projects to choose from when creating a new issue.

It's about a NPE in 
_org.apache.logging.log4j.core.async.RingBufferLogEventHandler4.notifyCallback():_
 it tries to use an instance variable _sequenceCallback_ that is not set. The 
version of log4j2 I'm using in {_}v2.24.3{_}, in combination with _disruptor_ 
{_}v3.4.4.202406060700{_}. According to the manifest file of log4j2-core, the 
accepted range of versions of disruptor is from 3.4 to 4 (excluded).

But it appears to me that the _RingBufferLogEventHandler4_ implementation is 
conceived for disruptor 4. There is a method defined to set the value of 
{_}sequenceCallback{_}:
{color:#000000} {color}{color:#3f7f5f}/*{color}

{color:#3f7f5f} * Overrides a method from Disruptor 4.x. Do not remove.{color}

{color:#3f7f5f} */{color}

{color:#7f0055}public{color}{color:#000000} 
{color}{color:#7f0055}void{color}{color:#000000} 
setSequenceCallback({color}{color:#7f0055}final{color}{color:#000000} Sequence 
{color}{color:#6a3e3e}sequenceCallback{color}{color:#000000}) {{color}

{color:#7f0055}this{color}{color:#000000}.{color}{color:#0000c0}sequenceCallback{color}{color:#000000}
 = {color}{color:#6a3e3e}sequenceCallback{color}{color:#000000};{color}

{color:#000000} }{color}

 

So I suspect this code is actually meant to work with disruptor 4. I am working 
in an OSGI environment, so the version range in the Manifest file is used to 
determine which version of disruptor to use.

 

Can someone look at this, or indicate me how to create a proper issue on the 
LOG4J project for this. As it is now, we cannot use asynchronous logging due to 
this NPE. I suppose it is about correcting the version range to accept 
disruptor 4, or not to use the _RingBufferLogEventHandler4_ if working with 
disruptor 3.4.x.

> NullPointerException from AsyncLogger
> -------------------------------------
>
>                 Key: LOG4J2-2816
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2816
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.13.0
>            Reporter: Denis
>            Assignee: Volkan Yazici
>            Priority: Minor
>             Fix For: 3.0.0, 2.15.0
>
>
> We've got several times following NullPointerException (example from our 
> stdout.log):
>   
> {code:java}
> 84449.232: [purging class loader data graph, 0.0000003 secs]
> AsyncLogger error handling event seq=1037012, 
> value='org.apache.logging.log4j.core.async.RingBufferLogEvent@2a7b2d78': 
> java.lang.NullPointerException: null
> java.lang.NullPointerException
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:161)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:46)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:29)
>  at 
> com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
>  at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
>  at java.lang.Thread.run(Thread.java:748)
> AsyncLogger error handling event seq=1037022, 
> value='org.apache.logging.log4j.core.async.RingBufferLogEvent@d5d330f': 
> java.lang.NullPointerException: null
> java.lang.NullPointerException
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:161)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:46)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:29)
>  at 
> com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
>  at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
>  at java.lang.Thread.run(Thread.java:748)
> 84450.232: [deflating idle monitors, 0.0000624 secs]
> {code}
>  
> What is interesting this NPEs always preceeded by
> {code}
> 84449.232: [purging class loader data graph, 0.0000003 secs] vm message
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to