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

ASF GitHub Bot commented on FELIX-5107:
---------------------------------------

GitHub user tmielke opened a pull request:

    https://github.com/apache/felix/pull/40

    FELIX-5107: NPE in org.apache.felix.eventadmin.impl.adapter.LogEventA…

    …dapter if log msg is empty

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tmielke/felix EmptyLogMessage

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/felix/pull/40.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #40
    
----
commit 1a88fe0fb35308e083c37456fca9c9d406b52530
Author: Torsten Mielke <tmie...@redhat.com>
Date:   2015-11-18T09:13:14Z

    FELIX-5107: NPE in org.apache.felix.eventadmin.impl.adapter.LogEventAdapter 
if log msg is empty

----


> NPE 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
>              Labels: event, karaf
>
> 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
> "'org.apache.felix.eventadmin.impl.adapter.LogEventAdapter$1@2d945cb1' is 
> removed as a LogListener, since it threw an exception."
> 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";).routeId("reproducer-log-exception")
>               .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)

Reply via email to