You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/12/16 15:11:24 UTC
svn commit: r891243 -
/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java
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) {