You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Joshua Watkins (JIRA)" <ji...@apache.org> on 2011/08/22 12:31:28 UTC

[jira] [Created] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Allow for static file handlers to be added to the jetty component
-----------------------------------------------------------------

                 Key: CAMEL-4363
                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
             Project: Camel
          Issue Type: New Feature
          Components: camel-jetty
    Affects Versions: 2.6.0
            Reporter: Joshua Watkins
            Priority: Minor


As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html

A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095877#comment-13095877 ] 

Willem Jiang commented on CAMEL-4363:
-------------------------------------

Current camel-jetty component just binds one servlet to the JettyServer, so it is impossible to add the ResourceHandler there.
To support it , we need to create one servlet per jetty endpoint and just attach the consumer into the servlet.
It make sense that if we have multi jetty endpoint which has different configuration of session or security.
 

> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097977#comment-13097977 ] 

Willem Jiang commented on CAMEL-4363:
-------------------------------------

I just did some test on the current Jetty component, and found that jetty component use one servlet is because we will face the handler already start issue if we create on servlet per jetty endpoint.
{code}
java.lang.IllegalStateException: STARTED
	at org.eclipse.jetty.server.handler.HandlerWrapper.setServer(HandlerWrapper.java:124)
	at org.eclipse.jetty.server.handler.ContextHandler.setServer(ContextHandler.java:237)
        at org.eclipse.jetty.server.handler.HandlerCollection.setHandlers(HandlerCollection.java:85)
	at org.eclipse.jetty.server.handler.HandlerCollection.addHandler(HandlerCollection.java:277)
{code}

Now I didn't find a way to fix this issue as we can't stop the server and start the handler again which is dangerous when the server is handling an important request. 

So I suggest to close this issue as there is a way to workaround this issue by applying a custom processor to deal with the resource request.



> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098514#comment-13098514 ] 

Willem Jiang commented on CAMEL-4363:
-------------------------------------

@Joshua,
Because jetty endpoint share the server which listen to the same port across the JVM. If we don't publish the servlet on the root, we can't add or remove the http consumer dynamically without stopping the server. The side effect of this is we can't let the resource handler work as expect.


> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Posted by "Joshua Watkins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098069#comment-13098069 ] 

Joshua Watkins commented on CAMEL-4363:
---------------------------------------

Is there any way to be able to set these bean via some type of configuration before he jetty component is instantiated? (Similar to the way you can set various options on the JMS/ActiveMQ component which is used by camel)

> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

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

Willem Jiang reassigned CAMEL-4363:
-----------------------------------

    Assignee: Willem Jiang

> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

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

Willem Jiang resolved CAMEL-4363.
---------------------------------

    Resolution: Won't Fix

Current there is no solution for it.

> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4363) Allow for static file handlers to be added to the jetty component

Posted by "Joshua Watkins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098814#comment-13098814 ] 

Joshua Watkins commented on CAMEL-4363:
---------------------------------------

I think I understand what you are saying. I will have to get myself a bit more familiar with the workings of the Jetty Servlet to fully understand the issue. The interesting thing is that the CometD component allows for a resource base to be set to serve up static files. (I guess this is due to it setting the cometD component to /comet and a DefaultServlet on /.)

Thanks for taking a look at this.

> Allow for static file handlers to be added to the jetty component
> -----------------------------------------------------------------
>
>                 Key: CAMEL-4363
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4363
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-jetty
>    Affects Versions: 2.6.0
>            Reporter: Joshua Watkins
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: camel-jetty, handler, jetty
>
> As per the discussion here: http://camel.465427.n5.nabble.com/Serving-static-pages-with-JettyComponent-td4711870.html
> A Jetty ResourceHandler or a ServletContextHandler cannot be added to the jetty server to serve up pages that are not processed via camel routes. It would be nice to utilize the currently running jetty server to serve up pages/resources other than those represented via camel routes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira