camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r891243 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java
Date Wed, 16 Dec 2009 14:11:24 GMT
Author: ningjiang
Date: Wed Dec 16 14:11:24 2009
New Revision: 891243

URL: http://svn.apache.org/viewvc?rev=891243&view=rev
Log:
CAMEL-2297 Checking the CamelContext in MainSupport to avoid no CamelContext to be loaded

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java?rev=891243&r1=891242&r2=891243&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java Wed Dec 16
14:11:24 2009
@@ -30,6 +30,7 @@
 import javax.xml.bind.JAXBException;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.CamelException;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.model.RouteDefinition;
@@ -317,6 +318,9 @@
 
     protected void postProcessContext() throws Exception {
         Map<String, CamelContext> map = getCamelContextMap();
+        if (map.size() == 0) {
+            throw new CamelException("Can't find any Camel Context from the Application Context.
Please check your Application Context setting");
+        }
         Set<Map.Entry<String, CamelContext>> entries = map.entrySet();
         int size = entries.size();
         for (Map.Entry<String, CamelContext> entry : entries) {



Mime
View raw message