my dog learned polymorphism
The moose likes JSF and the fly likes java.lang.RuntimeException: Cannot find FacesContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "java.lang.RuntimeException: Cannot find FacesContext" Watch "java.lang.RuntimeException: Cannot find FacesContext" New topic

java.lang.RuntimeException: Cannot find FacesContext

prabath Manjula

Joined: Dec 31, 2010
Posts: 1
Please assist me

I have written a simple JSF application using Netbeans IDE. It works when I run using the IDE. But after creating the WAR file and i deployed it on apache-tomcat-6.0.16\webapps. It Gives an error as below mentioned.


org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jsp at line 17

14: <title>Login Page</title>
15: </head>
16: <body>
17: <f:view>
18: <h:form id="LoginForm">
19: <h:panelGrid id="lpg" columns="2">


root cause

java.lang.RuntimeException: Cannot find FacesContext


please assist me to solve this issue. I visited the solutions for the same issue. As it mentioned I addedd this




Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Prabath

It appears that you have a problem with jsf libraries, verifies that in the war that was generated in the WEB-INF/lib folder are the jsf jars: jsf-api, jsf-impl.



When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 199
Since there is a JSF class in the stack trace (that is trying to find the FaceContext) I think that the point Cesar made is not the issue. But you should still check that the libraries he mentioned are present of course!

But you say that the error is shown right after the war is deployed. Are you sure? It looks like the error is actually shown WHEN you try to go to login.jsp. So if that is the case be sure to include all the necessary information when describing your problem from now on.

If the FacesContext is not found maybe there was already a problem in the deployment and there might be a more important error message in the logs at the deployment stage! In that case the error is probably in catalina.log
tun lynn

Joined: Apr 26, 2012
Posts: 3
I too has java.lang.RuntimeException: Cannot find FacesContext my case I already have those jars in lib folder...deployment is also OK...

I am not sure I am using the corredt URL or the web.xml setting is off....not sure which?!!

here is my posting on the subject

can anybody help please ??
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Please don't dredge up old dead threads just to repeat a question you've already asked. It clutters up the forum.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: java.lang.RuntimeException: Cannot find FacesContext
It's not a secret anymore!