Hi Jonny

You are right, the parameter check should be moved to a right place.
I just create a JIRA[1] to trace this issue.

Thanks for pointing that out, I will commit a quick fix for it shortly.

[1]https://issues.apache.org/jira/browse/CAMEL-8786

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 21, 2015 at 1:19:16 PM, jonnyry (jonny.ryla...@vitalsignssoftware.com) 
wrote:
> I'm using Camel with Tomcat and receiving the following log message when
> passing a route context parameter via web.xml (which I think may be a bug?):
>  
> [RMI TCP Connection(3)-127.0.0.1] INFO
> org.apache.camel.component.servletlistener.CamelServletContextListener -  
> There are 1 ServletContext init parameters, unknown to Camel. Maybe they are
> used by other frameworks? [{routeBuilder-routes=com.mycompany.MyRoute}]
>  
> However the context parameter it is referring to (see below for web.xml)
> then goes on to be processed correctly as a route:
>  
> [RMI TCP Connection(3)-127.0.0.1] INFO
> org.apache.camel.component.servletlistener.ServletCamelContext - Total 1
> routes, of which 1 is started.
>  
> This is the entirely of my web.xml:
>  
>  
>  
>  
>  
> org.apache.camel.component.servletlistener.JndiCamelServletContextListener  
>  
>  
>  
> routeBuilder-routes
> com.mycompany.MyRoute
>  
>  
>  
> CamelServlet
>  
> org.apache.camel.component.servlet.CamelHttpTransportServlet  
> 1
>  
>  
>  
> CamelServlet
> /camel/*
>  
>  
>  
>  
> I think the bug may be in the following file:
>  
> https://github.com/apache/camel/blob/master/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java
>   
>  
> The following lines (122 - 125) are executed before the routes are added
> (the next set of statements):
>  
> // just log if we could not use all the parameters, as they may be used by
> others
> if (!map.isEmpty()) {
> LOG.info("There are {} ServletContext init parameters, unknown
> to Camel. Maybe they are used by other frameworks? [{}]", map.size(), map);
> }
>  
> Should these lines be after the route adding takes place?
>  
> Thanks
> Jonny
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ServletContext-init-parameters-unknown-to-Camel-tp5767347.html
>   
> Sent from the Camel Development mailing list archive at Nabble.com.
>  

Reply via email to