• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.RuntimeException: Cannot find FacesContext

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
20:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.RuntimeException: Cannot find FacesContext
javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:118)


--------------------


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

<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>

thanks

Prabath

 
Ranch Hand
Posts: 90
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Regards

Cesar
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too has java.lang.RuntimeException: Cannot find FacesContext problem...in 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

https://coderanch.com/t/579213/JSF/java/url

can anybody help please ??
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't dredge up old dead threads just to repeat a question you've already asked. It clutters up the forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic