You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/09/18 14:12:51 UTC

[jira] Created: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

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
             Fix For: 2.1.0, 2.2.0


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.


[jira] Commented: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54341#action_54341 ] 

Claus Ibsen commented on CAMEL-2024:
------------------------------------

What is required now is to add a init parameter to the servlet
{code}
    <!-- set the camel context application file location here -->
    <init-param>
      <param-name>contextConfigLocation</param-name>
	  <param-value>/org/apache/camel/component/servlet/camelContext.xml</param-value>
    </init-param>
{code}

Which is not cool. For example you cannot have it in WEB-INF/applicationContext.xml as many people will have.

> 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
>             Fix For: 2.1.0, 2.2.0
>
>
> 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.


[jira] Issue Comment Edited: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Assigned: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-2024:
-----------------------------------

    Assignee: Willem Jiang

> 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
>
>
> 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.


[jira] Resolved: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-2024.
---------------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: 2.2.0)

> 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
>
>         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.


[jira] Updated: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang updated CAMEL-2024:
--------------------------------

    Attachment: camel-2024.patch

> 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.


[jira] Commented: (CAMEL-2024) camel-serlvet - It should be work with alongside spring loading using context listener

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ 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.