MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-75

ExtensionsFilter results in empty response on Jetty 6

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP SP2, Jetty 6 as part of the Jetty6 plugin for maven2

      Description

      When deploying a MyFaces webapp that uses the ExtensionsFilter in Jetty6, the response is always empty.
      You can verify this by adding this to the tomahawk/examples/simple/pom.xml:

      <plugins>
      <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty6-plugin</artifactId>
      <version>6.0.0beta9</version>
      <configuration>
      <scanIntervalSeconds>10</scanIntervalSeconds>
      </configuration>
      </plugin>
      </plugins>

      And then typing mvn jetty6:run in the same folder.
      Now you can access the simple example at http://localhost:8080/myfaces-example-simple/
      Normally you will now see a completely empty page...

        Activity

        Jurgen Lust created issue -
        Hide
        Bill Dudney added a comment -

        Jurgen,

        The jetty m2 plugin is trying to deploy from the src directory instead of from the target dir. Any idea how to make the m2 plugin deploy from the target dir? IOW, the src dir does not have the jars for myfaces but the target does. I've pasted the stack trace that I get from m2 below.

        Also since few of us are that familiar with Jetty (as far as I know anyway) perhaps you could do some digging to help us find the problem?

        Thanks again for using myfaces!

        [INFO] Configuring Jetty for project: Tomahawk Examples: Simple
        [INFO] Webapp source directory is: .../myfaces-current/tomahawk/examples/simple/src/main/webapp
        [INFO] web.xml file located at: .../myfaces-current/tomahawk/examples/simple/src/main/webapp/WEB-INF/web.xml
        [INFO] Classes located at: .../myfaces-current/tomahawk/examples/simple/target/classes
        [INFO] tmp dir for webapp will be .../myfaces-current/tomahawk/examples/simple/target/jetty-tmp
        [INFO] Starting Jetty Server ...
        [INFO] No connectors configured, using defaults: org.mortbay.jetty.nio.SelectChannelConnector listening on 8080 with maxIdleTime 30000
        1 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@d71256 via org.mortbay.log.Slf4jLog
        [INFO] Context path = /myfaces-example-simple
        [INFO] Webapp directory = .../myfaces-current/tomahawk/examples/simple/src/main/webapp
        [INFO] Setting up classpath ...
        [INFO] Finished setting up classpath
        [INFO] Started configuring web.xml, resource base=.../myfaces-current/tomahawk/examples/simple/src/main/webapp
        [INFO] Finished configuring web.xml
        1560 [main] WARN org.mortbay.log - failed Faces Servlet
        1562 [main] WARN org.mortbay.log - failed ContextHandler@a9da7

        {/myfaces-example-simple,file:.../myfaces-current/tomahawk/examples/simple/src/main/webapp/}

        1621 [main] INFO org.mortbay.log - Started SelectChannelConnector @ 0.0.0.0:8080
        1622 [main] WARN org.mortbay.log - failed Server@751a9b
        [INFO] Jetty server exiting.
        [INFO] ----------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ----------------------------------------------------------------------------
        [INFO] Failure

        Embedded error: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
        If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
        A typical config looks like this;
        <listener>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
        </listener>

        Show
        Bill Dudney added a comment - Jurgen, The jetty m2 plugin is trying to deploy from the src directory instead of from the target dir. Any idea how to make the m2 plugin deploy from the target dir? IOW, the src dir does not have the jars for myfaces but the target does. I've pasted the stack trace that I get from m2 below. Also since few of us are that familiar with Jetty (as far as I know anyway) perhaps you could do some digging to help us find the problem? Thanks again for using myfaces! [INFO] Configuring Jetty for project: Tomahawk Examples: Simple [INFO] Webapp source directory is: .../myfaces-current/tomahawk/examples/simple/src/main/webapp [INFO] web.xml file located at: .../myfaces-current/tomahawk/examples/simple/src/main/webapp/WEB-INF/web.xml [INFO] Classes located at: .../myfaces-current/tomahawk/examples/simple/target/classes [INFO] tmp dir for webapp will be .../myfaces-current/tomahawk/examples/simple/target/jetty-tmp [INFO] Starting Jetty Server ... [INFO] No connectors configured, using defaults: org.mortbay.jetty.nio.SelectChannelConnector listening on 8080 with maxIdleTime 30000 1 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@d71256 via org.mortbay.log.Slf4jLog [INFO] Context path = /myfaces-example-simple [INFO] Webapp directory = .../myfaces-current/tomahawk/examples/simple/src/main/webapp [INFO] Setting up classpath ... [INFO] Finished setting up classpath [INFO] Started configuring web.xml, resource base=.../myfaces-current/tomahawk/examples/simple/src/main/webapp [INFO] Finished configuring web.xml 1560 [main] WARN org.mortbay.log - failed Faces Servlet 1562 [main] WARN org.mortbay.log - failed ContextHandler@a9da7 {/myfaces-example-simple,file:.../myfaces-current/tomahawk/examples/simple/src/main/webapp/} 1621 [main] INFO org.mortbay.log - Started SelectChannelConnector @ 0.0.0.0:8080 1622 [main] WARN org.mortbay.log - failed Server@751a9b [INFO] Jetty server exiting. [INFO] ---------------------------------------------------------------------------- [ERROR] BUILD ERROR [INFO] ---------------------------------------------------------------------------- [INFO] Failure Embedded error: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this; <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener>
        Hide
        Jurgen Lust added a comment -

        The jetty plugin gets the myfaces libraries from the dependencies of the project, as specified in the POM.
        The problem you are having is related to the startupServletContextListener: apparently Jetty does not yet support listeners via TLD files, so you should add the following lines to the web.xml of the tomahawk simple example web.xml:

        <listener>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
        </listener>

        Now it should start correctly.

        I've been trying to locate the problem, but haven't found the exact source yet.
        I have noticed that in the ExtensionsResponseWrapper there is a comment that Jetty uses the getOutputStream() method, whereas Tomcat uses the getWriter() method, which is not the case for Jetty6: it also uses the getWriter() method.

        Anyway, it has been a while since I wrote ServletFilters and such - JSF does such a good job hiding all that request/response complexity I haven't needed it anymore - so it might take me a while to figure out how this thing works...

        Show
        Jurgen Lust added a comment - The jetty plugin gets the myfaces libraries from the dependencies of the project, as specified in the POM. The problem you are having is related to the startupServletContextListener: apparently Jetty does not yet support listeners via TLD files, so you should add the following lines to the web.xml of the tomahawk simple example web.xml: <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> Now it should start correctly. I've been trying to locate the problem, but haven't found the exact source yet. I have noticed that in the ExtensionsResponseWrapper there is a comment that Jetty uses the getOutputStream() method, whereas Tomcat uses the getWriter() method, which is not the case for Jetty6: it also uses the getWriter() method. Anyway, it has been a while since I wrote ServletFilters and such - JSF does such a good job hiding all that request/response complexity I haven't needed it anymore - so it might take me a while to figure out how this thing works...
        sean schofield made changes -
        Field Original Value New Value
        Component/s Tomahawk [ 12310162 ]
        Project MyFaces Core [ 10600 ] MyFaces Tomahawk [ 12310272 ]
        Affects Version/s Nightly [ 12310660 ]
        Affects Version/s 1.1.1 [ 12310262 ]
        Component/s Other [ 12310767 ]
        Key MYFACES-1126 TOMAHAWK-75
        Hide
        Jurgen Lust added a comment -

        This appears to be an issue with Jetty 6, and not with MyFaces. It has been fixed in the latest snapshot of the Jetty6 plugin

        Show
        Jurgen Lust added a comment - This appears to be an issue with Jetty 6, and not with MyFaces. It has been fixed in the latest snapshot of the Jetty6 plugin
        Hide
        sean schofield added a comment -

        Closing at Jurgen's suggestion.

        Show
        sean schofield added a comment - Closing at Jurgen's suggestion.
        sean schofield made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        sean schofield made changes -
        Workflow jira [ 12347091 ] MyFaces Workflow [ 12347594 ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12347594 ] MyFaces Workflow2 [ 12349376 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12349376 ] MyFaces Workflow [ 12354467 ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12354467 ] MyFaces Workflow2 [ 12356397 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12356397 ]  MyFaces Workflow [ 12357041 ]
        sean schofield made changes -
        Workflow  MyFaces Workflow [ 12357041 ] MyFaces Workflow2 [ 12361054 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        6d 7h 27m 1 sean schofield 22/Feb/06 06:02

          People

          • Assignee:
            Unassigned
            Reporter:
            Jurgen Lust
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development