0

I am trying to create a simple program on JSF.I deployed it on JBOSS 5 server.But when i try to run it it throws these exception.

type Exception report

message description The server encountered an internal error () that prevented it from fulfilling this request.

exception org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.RuntimeException: Cannot find FacesContext javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855) javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672) org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:90) org.apache.jsp.index_jsp._jspService(index_jsp.java:67) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
nissal
  • 27
  • 1
  • 2
  • 10
  • Can you please post your code? and your folder structure too. What libraries are you adding in your `WEB-INF/lib`? – HashimR Jun 13 '12 at 06:46

1 Answers1

3

This exception will be thrown when the request URL as appears in the browser's address bar does not match the <url-pattern> of the FacesServlet as definied in webapp's web.xml. If the FacesServlet is not invoked, then the FacesContext will not be created and then the JSF components in your JSP page will throw this exception.

If the URL pattern is for example

<url-pattern>*.jsf</url-pattern>

then you should be opening the page by using index.jsf in browser address bar instead of index.jsp.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555