camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener
Date Thu, 29 Oct 2009 01:04:54 GMT

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

Willem Jiang edited comment on CAMEL-2024 at 10/28/09 6:03 PM:
---------------------------------------------------------------

@ 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 marked it as won't fix.


      was (Author: njiang):
    @ 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.


Mime
View raw message