Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 5220 invoked from network); 18 Feb 2010 23:51:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Feb 2010 23:51:04 -0000 Received: (qmail 2261 invoked by uid 500); 18 Feb 2010 23:51:03 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 2230 invoked by uid 500); 18 Feb 2010 23:51:03 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 2220 invoked by uid 500); 18 Feb 2010 23:51:03 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 2217 invoked by uid 99); 18 Feb 2010 23:51:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 23:51:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 23:51:01 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1E70D29A0012 for ; Thu, 18 Feb 2010 15:50:40 -0800 (PST) Message-ID: <1897489623.3821266537040119.JavaMail.jira@brutus.apache.org> Date: Thu, 18 Feb 2010 23:50:40 +0000 (UTC) From: "Michael Mathers (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Updated: (CAMEL-2486) DefaultCamelContext throws NPE in start() for route with no destination In-Reply-To: <2101152552.3591266525520134.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Mathers updated CAMEL-2486: ----------------------------------- Description: Not easy to track down when you have a lot of routes. This might be new with the introduction of StartupRouteHolder (I think that was introduced in 2.1, right?) {code} public class TriggerNPETest extends CamelTestSupport { @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() { // This will generate an NPE on DefaultCamelContext.start() (line 973) // If this is an invalid route a proper message should be given far before // this and/or NPE should be tested on line 973 from("direct:psd.nowhere"); } }; } @Test public void testme() throws Exception { Thread.sleep(10000); } } {code} java.lang.NullPointerException at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:973) at org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:145) at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:98) {code} // now start the inputs for all the route services as we have prepared Camel // yeah open the floods so messages can start flow into Camel for (Map.Entry entry : inputs.entrySet()) { Integer order = entry.getKey(); Route route = entry.getValue().getRoute(); // <<<------- Right here. {code} was: Not easy to track down when you have a lot of routes. This might be new with the introduction of StartupRouteHolder (I think that was introduced in 2.2, right?) {code} public class TriggerNPETest extends CamelTestSupport { @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() { // This will generate an NPE on DefaultCamelContext.start() (line 973) // If this is an invalid route a proper message should be given far before // this and/or NPE should be tested on line 973 from("direct:psd.nowhere"); } }; } @Test public void testme() throws Exception { Thread.sleep(10000); } } {code} java.lang.NullPointerException at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:973) at org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:145) at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:98) {code} // now start the inputs for all the route services as we have prepared Camel // yeah open the floods so messages can start flow into Camel for (Map.Entry entry : inputs.entrySet()) { Integer order = entry.getKey(); Route route = entry.getValue().getRoute(); // <<<------- Right here. {code} > DefaultCamelContext throws NPE in start() for route with no destination > ----------------------------------------------------------------------- > > Key: CAMEL-2486 > URL: https://issues.apache.org/activemq/browse/CAMEL-2486 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.1.0 > Environment: Camel 2.2, Linux, Java 6 > Reporter: Michael Mathers > Priority: Minor > > Not easy to track down when you have a lot of routes. This might be new with the introduction of StartupRouteHolder (I think that was introduced in 2.1, right?) > {code} > public class TriggerNPETest extends CamelTestSupport { > @Override > protected RouteBuilder createRouteBuilder() throws Exception { > return new RouteBuilder() { > public void configure() { > // This will generate an NPE on DefaultCamelContext.start() (line 973) > // If this is an invalid route a proper message should be given far before > // this and/or NPE should be tested on line 973 > from("direct:psd.nowhere"); > } > }; > } > @Test > public void testme() throws Exception { > Thread.sleep(10000); > } > } > {code} > java.lang.NullPointerException > at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:973) > at org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:145) > at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:98) > {code} > // now start the inputs for all the route services as we have prepared Camel > // yeah open the floods so messages can start flow into Camel > for (Map.Entry entry : inputs.entrySet()) { > Integer order = entry.getKey(); > Route route = entry.getValue().getRoute(); // <<<------- Right here. > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.