camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Bauhan <sven.bau...@ast.dfs.de>
Subject Bug in org.apache.camel.main.Main#doStop() ?
Date Fri, 28 Jun 2013 08:54:25 GMT
Hi,

I think I found a bug in org.apache.camel.main.Main#doStop():

When I call a Camel application with parameter -h all parameters are 
printed an the program exits.
But it is no clean exit; it throws an java.lang.IndexOutOfBoundsException.

The reason for this is the expression in doStop():
+
----
getCamelContexts().get(0).stop();
----

I implemented a workaround in my class derived from 
org.apache.camel.main.Main:
+
----
     @Override
     protected void doStop() throws Exception {
         List<?> contexts = getCamelContexts();
         if (contexts != null && ! contexts.isEmpty()) {
             super.doStop();
         } else {
             completed();
         }
     }
----

Is this a real bug, or did I just use org.apache.camel.main.Main the 
wrong way?

Thanks, Sven


Mime
View raw message