Based on MyFaces 2.0.5 source code, where the line numbers from your stack trace matches, the FacesContext#getAttributes()
look like this:
55 public Map<Object, Object> getAttributes()
56 {
57 FacesContext ctx = _firstInstance.get();
58
59 if (ctx == null)
60 {
61 throw new UnsupportedOperationException();
62 }
63
64 return ctx.getAttributes();
65 }
In other words, the _firstInstance.get()
is in your specific case incorrectly returning the current instance. This suggests that at some point in the code elsewhere the following action has taken place in JSF internal code:
FacesContext.setCurrentInstance(FacesContext.getCurrentInstance());
This is not right. The FacesContext
's current instance should not be referring to itself. It would only result in an infinite loop of accessing itself everytime, as evident by the stack trace.
Also, the fact that you apparently got your web application to successfully deploy with a Mojarra-specific listener in your web.xml
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
suggests that you've MyFaces' competitor Mojarra in webapp's runtime classpath. In other words, you're mixing two completely distinct JSF implementations! This is definitely not right. It's like mixing gasoline and diesel in one car engine. IBM WebSphere ships with MyFaces bundled. You should remove any Mojarra-related JAR files (jsf-api.jar
, jsf-impl.jar
and/or javax.faces.jar
), configuration entries (com.sun.faces.*
) and other artifacts from your webapp. They're conflicting with MyFaces.