This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Cannot find FacesContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Cannot find FacesContext " Watch "Cannot find FacesContext " New topic

Cannot find FacesContext

v kishore

Joined: Oct 23, 2010
Posts: 11
Hi Forum,
I am trying to deploy existing code in my localhost , i am using jboss-4.2.2.GA ,Mysql , windows OS.
while i try to call my index jsf file i am getting the following error.

" java.lang.RuntimeException: Cannot find FacesContext
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter( "

I tried with different mapping in my xml but no use.also check the jar in the libs for versions those are all fine.

even i get the same error in tomcat6 while i run the same application.

Here i my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="" xmlns:xsi="" version="2.4" xsi:schemaLocation="">


<servlet-name>Faces Servlet</servlet-name>

<servlet-name>Faces Servlet</servlet-name>



please assist me where i am missing.

Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
In your mapping you have

So only queries ending with .faces are handled by Faces Servlet. Is this correct for your application? For example calling your index page with index.jsp or with index.jsf would result in failure.
v kishore

Joined: Oct 23, 2010
Posts: 11
thanks for your reply.

while i try to call using the url like http://localhost:8080/myapp/index.faces
i am getting the following exception .



same thing in both jboss and tomcat.

Thank you
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
The exception and the fact that you include portlet tag library in web.xml hint that your application might be a portlet application and not a servlet application. Is that correct? I have no experience of portlets so I can not help you there.
v kishore

Joined: Oct 23, 2010
Posts: 11
i am sorry for not mentioning it before , yes it is portlet application ,
okay and thanks for you replies.
can any one suggest.
Don't get me started about those stupid light bulbs.
subject: Cannot find FacesContext
Similar Threads
Cannot find ActionMappings or ActionFormBeans collection with dbcp
jsf problem , java.lang.RuntimeException: Cannot find FacesContext error
a question about struts....please help
while creating jsf project
cannot forward to jsf page - unable to resolve jsf tag