Question

I have been asked to help with trouble-shooting an application issue.

Here is the background - We have a JSF 1.2 application running in WAS 7. This is one WAR. The team has added another WAR to the same application which is a JSF 2.0 module and uses PrimeFaces component library. Thus it is a combination of the JSF 1.2 and JSF 2.0. Because there is no native support for JSF 2.0 in WAS 7, we have added the mojarra jars to the WEB-INF/lib of the second war and have set the application classloader to be PARENT_LAST.

One other thing I observed is that this team has defined their application in such a way that the display name of the EAR in application.xml and context-root value of the JSF 2.0 WAR are exactly the SAME. I know it should not be done this way for clarity, but could not find anything that clarifies it.

When trying to bring the page from the JSF 2.0 WAR, the application is getting below error. I will add only a few lines of the stack trace

Exception created : java.lang.NoSuchMethodError: javax/faces/context/FacesContext.getAttributes()Ljava/util/Map;
at org.primefaces.lifecycle.RestoreViewPhaseListener.afterPhase(RestoreViewPhaseListener.java:30)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)

What else can I check to determine the cause of the error?

Was it helpful?

Solution

This was a partial set-up issue. The EAR classloader was set to PARENT_LAST, but the WAR classloader was not. Once we made it PARENT_LAST in both the places, it worked.

Putting this as an answer so that others having the same issue can find what fixed it from the answer than having to read comments.

If this is a bad etiquette, this can be deleted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top