[ 
https://issues.apache.org/activemq/browse/CAMEL-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55063#action_55063
 ] 

Willem Jiang commented on CAMEL-2024:
-------------------------------------

@ Claus
If we use the SpringContextLoaderListener, the camel context will start before 
the servlet register it to the ServletComponent. and the ServletComponent will 
compliant about it can't servlet when starting the endpoint. That is why I let 
the servlet load the application context itself.

I did some hack to let the camel context start after the  servlet started, but 
it will not work all the time, and it is not clean as the init parameter 
solution.
It also need user to set the autoStart flag in the camel context, and we need 
check the camel context status in the servlet.

So I just attached the patch in this JIRA, and markedit as won't fix.


> camel-serlvet - It should be work with alongside spring loading using context 
> listener
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2024
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2024
>             Project: Apache Camel
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.1.0, 2.2.0
>
>         Attachments: camel-2024.patch
>
>
> A web.xml like this
> {code:xml}
>     <listener>
>         
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>     </listener>
>     <servlet>
>         <servlet-name>CamelServlet</servlet-name>
>         <display-name>Camel Http Transport Servlet</display-name>
>         
> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
>         <init-param>
>             <param-name>matchOnUriPrefix</param-name>
>             <param-value>true</param-value>
>         </init-param>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>CamelServlet</servlet-name>
>         <url-pattern>/services/*</url-pattern>
>     </servlet-mapping>
> {code}
> Should be able to work as spring is initialized as its always is using the 
> context listener. The CamelServlet should *not* try to load or create a 
> spring application context itself.
> Separation of concerns
> Non invasive

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to