Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: ERROR WHILE PROCESSING JSF FILE

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation ERROR WHILE PROCESSING JSF FILE

    Hi All,

    I am Pankaj and I am new to learning JSF Applications .
    I need some help regarding the following error that i encounter when running index.jsp file of a timezone application

    The error that I am getting is :
    __________________________________________________ ____________________________________

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

    2: <%@ taglib uri="http://java.sun.com/jsf/core" prefix = "fa" %>
    3: <%@ taglib uri="http://java.sun.com/jsf/html" prefix = "ha" %>
    4:
    5: <fa:view>
    6: <head>
    7: <title>The timezone application</title>
    8: </head>


    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:419)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

    root cause

    java.lang.RuntimeException: Cannot find FacesContext
    javax.faces.webapp.UIComponentClassicTagBase.getFa cesContext(UIComponentClassicTagBase.java:1855)
    javax.faces.webapp.UIComponentClassicTagBase.setJs pId(UIComponentClassicTagBase.java:1672)
    org.apache.jsp.index_jsp._jspx_meth_fa_005fview_00 5f0(index_jsp.java:99)
    org.apache.jsp.index_jsp._jspService(index_jsp.jav a:73)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    __________________________________________________ ____________________________________
    My index.jsp file source Code :

    __________________________________________________ ________________________________________


    <html>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix = "fa" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix = "ha" %>

    <fa:view>
    <head>
    <title>The timezone application</title>
    </head>

    <body>
    <ha:form>
    <p>
    The current date and time in
    <ha: outputText value = "#{zone.city}"/>
    is:
    <ha: outputText value = "#{zone.time}"/>
    </p>

    <p>
    Set time zone:
    <ha:inputText value = "#{zone.city}"/>
    </p>

    <p>
    <ha:commandButton value = "Submit"/>
    </p>

    </ha:form>
    </body>
    </fa:view>
    __________________________________________________ _____________________________________


    My faces-config.xml file:
    __________________________________________________ _____________________________________

    <?xml version="1.0"?>

    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

    <faces-config>
    <managed-bean>
    <managed-bean-name>zone</managed-bean-name>
    <managed-bean-class>bigjava.TimeZoneBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>city</property-name>
    <value>Los Angeles</value>
    </managed-property>
    </managed-bean>
    </faces-config>
    __________________________________________________ _____________________________________

    And my web.xml file:

    <?xml version="1.0"?>

    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>

    __________________________________________________ __________________________________________________ ________________________

    Please help me regarding this.
    Last edited by Pankaj; June 23rd, 2010 at 10:49 AM.


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: ERROR WHILE PROCESSING JSF FILE

    Do you have the right jar files on the classpath by any chance?

    // Json

  3. #3
    Junior Member
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: ERROR WHILE PROCESSING JSF FILE

    Is the missing </fa:view> tag the problem?

  4. #4
    Junior Member
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: ERROR WHILE PROCESSING JSF FILE

    @edburns : There is already a </fa:view> tag> Anyways Thanx for Helping.


    @JSon Can You Please list What all Jar Files I May Need?

Similar Threads

  1. Natural language processing in java
    By nikki. in forum Java Theory & Questions
    Replies: 5
    Last Post: March 20th, 2012, 12:34 AM
  2. Error in validation.xml file while deploying in server
    By venkat.ravala in forum Web Frameworks
    Replies: 0
    Last Post: January 16th, 2010, 08:56 AM
  3. Error msg : 'pageContext' cannot be resolved in tag file....
    By saikrishna436 in forum JavaServer Pages: JSP & JSTL
    Replies: 5
    Last Post: September 8th, 2009, 08:58 AM
  4. Error while deploying .ear file
    By urslalitha in forum Exceptions
    Replies: 1
    Last Post: August 18th, 2009, 03:56 AM
  5. Truncated class file error
    By Kok in forum Exceptions
    Replies: 4
    Last Post: June 23rd, 2009, 12:23 PM