You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Christopher Lockard (JIRA)" <ji...@apache.org> on 2017/05/15 21:32:05 UTC

[jira] [Updated] (KARAF-5124) NPE when location information is included in console logging pattern

     [ https://issues.apache.org/jira/browse/KARAF-5124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lockard updated KARAF-5124:
---------------------------------------
    Description: 
When including class and line in the console logger pattern a NPE is thrown when doing a log:tail or log:display. 
This appears to be a result of the KarafLogEvent not keeping the location information and the PatternParser not checking if location information is available before trying to use it. 
This is the pattern in org.apache.karaf.log.cfg that causes the NPE
`pattern = %d{ABSOLUTE} | %-5.5p | %-16.16t | %-40.40C %4L | %-20.20X{bundle.name} | %m%n`

This is the exception thrown
Exception in thread "pool-28-thread-1" java.lang.NullPointerException
	at org.apache.karaf.log.core.internal.layout.PatternParser$ClassNamePatternConverter.getFullyQualifiedName(PatternParser.java:511)
	at org.apache.karaf.log.core.internal.layout.PatternParser$NamedPatternConverter.convert(PatternParser.java:482)
	at org.apache.karaf.log.core.internal.layout.PatternConverter.format(PatternConverter.java:63)
	at org.apache.karaf.log.core.internal.LogEventFormatterImpl.format(LogEventFormatterImpl.java:117)
	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:121)
	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:105)
	at org.apache.karaf.log.command.LogTail$PrintEventThread.run(LogTail.java:101)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

  was:
When including class and line in the console logger pattern a NPE is thrown when doing a log:tail or log:display. 
This appears to be a result of the KarafLogEvent not keeping the location information and the PatternParser not checking if location information is available before trying to use it. 
This is the pattern in org.apache.karaf.log.cfg that causes the NPE
pattern = %d{ABSOLUTE} | %-5.5p | %-16.16t | %-40.40C %4L | %-20.20X{bundle.name} | %m%n

This is the exception thrown
Exception in thread "pool-28-thread-1" java.lang.NullPointerException
	at org.apache.karaf.log.core.internal.layout.PatternParser$ClassNamePatternConverter.getFullyQualifiedName(PatternParser.java:511)
	at org.apache.karaf.log.core.internal.layout.PatternParser$NamedPatternConverter.convert(PatternParser.java:482)
	at org.apache.karaf.log.core.internal.layout.PatternConverter.format(PatternConverter.java:63)
	at org.apache.karaf.log.core.internal.LogEventFormatterImpl.format(LogEventFormatterImpl.java:117)
	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:121)
	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:105)
	at org.apache.karaf.log.command.LogTail$PrintEventThread.run(LogTail.java:101)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


> NPE when location information is included in console logging pattern
> --------------------------------------------------------------------
>
>                 Key: KARAF-5124
>                 URL: https://issues.apache.org/jira/browse/KARAF-5124
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.1
>            Reporter: Christopher Lockard
>             Fix For: 4.1.2
>
>
> When including class and line in the console logger pattern a NPE is thrown when doing a log:tail or log:display. 
> This appears to be a result of the KarafLogEvent not keeping the location information and the PatternParser not checking if location information is available before trying to use it. 
> This is the pattern in org.apache.karaf.log.cfg that causes the NPE
> `pattern = %d{ABSOLUTE} | %-5.5p | %-16.16t | %-40.40C %4L | %-20.20X{bundle.name} | %m%n`
> This is the exception thrown
> Exception in thread "pool-28-thread-1" java.lang.NullPointerException
> 	at org.apache.karaf.log.core.internal.layout.PatternParser$ClassNamePatternConverter.getFullyQualifiedName(PatternParser.java:511)
> 	at org.apache.karaf.log.core.internal.layout.PatternParser$NamedPatternConverter.convert(PatternParser.java:482)
> 	at org.apache.karaf.log.core.internal.layout.PatternConverter.format(PatternConverter.java:63)
> 	at org.apache.karaf.log.core.internal.LogEventFormatterImpl.format(LogEventFormatterImpl.java:117)
> 	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:121)
> 	at org.apache.karaf.log.command.DisplayLog.printEvent(DisplayLog.java:105)
> 	at org.apache.karaf.log.command.LogTail$PrintEventThread.run(LogTail.java:101)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)