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:

<web-app>

    <listener>
       
<listener-class>org.apache.camel.component.servletlistener.JndiCamelServletContextListener</listener-class>
    </listener>

    <context-param>
        <param-name>routeBuilder-routes</param-name>
        <param-value>com.mycompany.MyRoute</param-value>
    </context-param>

    <servlet>
        <servlet-name>CamelServlet</servlet-name>
       
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>CamelServlet</servlet-name>
        <url-pattern>/camel/*</url-pattern>
    </servlet-mapping>

</web-app>

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