You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2016/05/25 15:10:14 UTC

[jira] [Closed] (FELIX-5107) NullPointerException in org.apache.felix.eventadmin.impl.adapter.LogEventAdapter if log msg is empty

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

Carsten Ziegeler closed FELIX-5107.
-----------------------------------

> NullPointerException in org.apache.felix.eventadmin.impl.adapter.LogEventAdapter if log msg is empty
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5107
>                 URL: https://issues.apache.org/jira/browse/FELIX-5107
>             Project: Felix
>          Issue Type: Bug
>          Components: Event Admin
>    Affects Versions: eventadmin-1.4.4
>            Reporter: Torsten Mielke
>            Assignee: David Bosschaert
>              Labels: event, karaf
>             Fix For: eventadmin-1.4.6
>
>
> If a log event contains an empty message, it raises an NPE in  
> https://github.com/apache/felix/blob/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/adapter/LogEventAdapter.java#L180
> As a result the Karaf container will raise
> {noformat}
> 'org.apache.felix.eventadmin.impl.adapter.LogEventAdapter$1@XXXXXX' is removed as a LogListener, since it threw an exception.
> {noformat}
> to stderr and remove this event admin instance.
> An empty log message may sound like a stupid thing to do but may happen as a result of e.g. running a Camel route like this one deployed in a Karaf container:
> {code:java}
> public class LogExceptionRoute extends RouteBuilder {
> 	
>     @Override
> 	public void configure() {
> 		onException(Throwable.class)
> 		    .handled(true)
> 		    .log(LoggingLevel.ERROR, "${exception.message}");
> 		from("jetty:http://0.0.0.0:8005")
> 		.throwException(new Exception()); 
> 	}	
> }
> {code}
> The route raises an empty exception (i.e. no detail message) which then get logged in the onException() policy, causing the error above.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)