Issue Details (XML | Word | Printable)

Key: APF-856
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Matt Raible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

404 page doesn't work with JSF 1.2 with maven-jetty-plugin

Created: 29/Aug/07 12:02 PM   Updated: 17/Sep/08 09:50 PM   Resolved: 03/May/08 11:11 PM
Component/s: Web - JSF
Affects Version/s: 2.0-M5
Fix Version/s: 2.0.2


 Description  « Hide
When viewing a page that doesn't exist, the following (from messages.jsp) throws the error below:

<c:if test="${not empty errors}">
    <div class="error" id="errorMessages">
        <c:forEach var="error" items="${errors}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
</c:if>

Caused by: javax.faces.el.EvaluationException: ELResolver cannot handle a null base Object with identifier 'errors'

Everything works fine on Tomcat 6.0.14.

http://www.nabble.com/Is-it-possible-to-exclude-commons-el-as-a-dependency-with-the-maven-jetty-plugin--tf4348944.html#a12391297

Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 13/Sep/07 04:25 PM
If I modify the code as follows, the 404 page will work. However, the ${appConfig["csstheme"]} variable isn't resolved and therefore no stylesheets are rendered.

Index: src/main/java/org/appfuse/webapp/filter/MessageFilter.java
===================================================================
--- src/main/java/org/appfuse/webapp/filter/MessageFilter.java (revision 2936)
+++ src/main/java/org/appfuse/webapp/filter/MessageFilter.java (working copy)
@@ -1,6 +1,7 @@
 package org.appfuse.webapp.filter;
 
 import java.io.IOException;
+import java.util.ArrayList;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
@@ -31,6 +32,10 @@
         if (messages != null) {
             request.setAttribute("messages", messages);
             request.getSession().removeAttribute("messages");
+ } else {
+ // workaround for issue with Jetty 6.1.5 (Maven Plugin) and MyFaces 1.2.0
+ // http://issues.appfuse.org/browse/APF-856
+ request.setAttribute("messages", new ArrayList());
         }
         
         // grab errors from the session and put them into request
@@ -40,6 +45,10 @@
         if (errors != null) {
             request.setAttribute("errors", errors);
             request.getSession().removeAttribute("errors");
+ } else {
+ // workaround for issue with Jetty 6.1.5 (Maven Plugin) and MyFaces 1.2.0
+ // http://issues.appfuse.org/browse/APF-856
+ request.setAttribute("errors", new ArrayList());
         }
 
         chain.doFilter(req, res);

Matt Raible added a comment - 13/Sep/07 04:27 PM
Posted question to the MyFaces mailing list:

http://tinyurl.com/2rq5s6

Matt Raible added a comment - 13/Sep/07 04:27 PM
Moved to 2.0.1 since this seems to be an issue with Jetty.

Matt Raible added a comment - 14/Sep/07 10:19 AM
Reverted patch from r2941 as it causes success messages to not be rendered:

http://fisheye4.cenqua.com/changelog/appfuse?cs=2941

404 doesn't work with JSF on Jetty, but it works with Tomcat.

Matt Raible added a comment - 24/Nov/07 12:45 PM

Matt Raible added a comment - 24/Nov/07 12:46 PM
Seems to be a bug in Jetty or MyFaces. Since it's not solved by upgrading to Jetty 6.1.6, I'm deferring this bug until it's fixed by one of those libraries.

Matt Raible added a comment - 03/May/08 11:11 PM
Appears to be fixed by upgrading to MyFaces 1.2.2.