Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 86FA5180AE for ; Wed, 18 Nov 2015 12:35:11 +0000 (UTC) Received: (qmail 32497 invoked by uid 500); 18 Nov 2015 12:35:11 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 32432 invoked by uid 500); 18 Nov 2015 12:35:11 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 32398 invoked by uid 99); 18 Nov 2015 12:35:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2015 12:35:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EB3FB2C0450 for ; Wed, 18 Nov 2015 12:35:10 +0000 (UTC) Date: Wed, 18 Nov 2015 12:35:10 +0000 (UTC) From: "David Bosschaert (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-5107) NullPointerException in org.apache.felix.eventadmin.impl.adapter.LogEventAdapter if log msg is empty MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-5107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Bosschaert resolved FELIX-5107. ------------------------------------- Resolution: Fixed Thanks for your patch, [~tmielke]! I've applied it in http://svn.apache.org/viewvc?view=revision&revision=1714987 > 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 > > 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)