camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Bug in org.apache.camel.main.Main#doStop() ?
Date Wed, 03 Jul 2013 02:12:43 GMT
Hi,

I just had a quick look of the code and confirmed it's a bug.
I will commit a quick fix for it shortly.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, July 2, 2013 at 7:42 PM, Sven Bauhan wrote:

>  
> I opened a bug report: https://issues.apache.org/jira/browse/CAMEL-6504
>  
> On 06/28/13 12:10, Christian Müller wrote:
> > I cannot look into the code yet, but I think this should be fixed. Feel
> > free to create a JIRA.
> >  
> > Best,
> > Christian
> >  
> > Sent from a mobile device
> > Am 28.06.2013 10:54 schrieb "Sven Bauhan" <sven.bauhan@ast.dfs.de (mailto:sven.bauhan@ast.dfs.de)>:
> >  
> > > 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