Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:14:19+00:00 2026-05-25T10:14:19+00:00

I am getting following exception while I am trying to run a basic JSF

  • 0

I am getting following exception while I am trying to run a basic JSF application . I am using JSF1.1 , JDK 6 and tomcat 6.0.18 for the same.

exception

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

exception 

javax.servlet.ServletException: Error testing property 'lastname' in bean of type null
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)


root cause 

javax.faces.el.PropertyNotFoundException: Error testing property 'lastname' in bean of type null
    com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:342)
    com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:240)
    com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:208)
    com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:345)
    com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:111)
    javax.faces.component.UIInput.getConvertedValue(UIInput.java:713)
    javax.faces.component.UIInput.validate(UIInput.java:638)
    javax.faces.component.UIInput.executeValidate(UIInput.java:849)
    javax.faces.component.UIInput.processValidators(UIInput.java:412)
    javax.faces.component.UIForm.processValidators(UIForm.java:170)
    javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:912)
    javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
    com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

Following are the files I have created for the same :

//jsfmbean.jsp

<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">

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

<f:view>
<html>
<body bgcolor="cyan">
<h:form id="form1" >
<h:inputText id="text1" value="#{text2}" />
<h:inputText id="text2" value="#{player.lastname}" />
 <h:commandButton action="success" value="success" />
 <h:commandButton action="#{player.changeName}" value="failure" />
 </h:form>
</body>
</html>
</f:view>

//faces-config.xml

<?xml version='1.0' encoding='UTF-8'?>

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



<faces-config>

  <application>

  <locale-config>

  <default-locale>en</default-locale>  

  </locale-config>

  </application>

  <navigation-rule> 


  <from-view-id> 
   /jsfevent.jsp 
  </from-view-id> 

  <navigation-case>
  <from-outcome>success</from-outcome> 
  <to-view-id>/mathew.jsp</to-view-id> 
   </navigation-case> 

   <navigation-case> 
   <from-outcome>failure</from-outcome> 
   <to-view-id>/amy.jsp</to-view-id> 
   </navigation-case> 
  </navigation-rule> 



  <navigation-rule> 
<from-view-id>/jsfmbean.jsp</from-view-id> 
<navigation-case> 
<from-outcome>success</from-outcome> 
<to-view-id>/mathew.jsp</to-view-id> 
</navigation-case> 
</navigation-rule> 

<managed-bean> 
<managed-bean-name>player</managed-bean-name> 
<managed-bean-class> 
ourdemo.player 
</managed-bean-class> 

<managed-bean-scope> 
session 
</managed-bean-scope> 

<managed-property> 
<property-name>firstname</property-name> 
<property-type>java.lang.String</property-type>
<value>Mahatma</value> 
</managed-property> 

<managed-property> 
<property-name>lastname</property-name> 
<property-type>java.lang.String</property-type>
<value>Gandhiji</value> 
</managed-property> 

</managed-bean>

</faces-config>

//Player.java

package ourdemo; 
import javax.faces.context.*; 
import javax.faces.component.*; 
import javax.faces.validator.*; 
public class Player 
{ 
String firstname ;  
String lastname ; 


public void setFirstname(String a) 
{ 
firstname=a; 
} 
public String getFirstname() 
{ 
return firstname; 
} 
//---------- 
public void setLastname(String b) 
{ 
lastname=b; 
} 
public String  getLastname() 
{ 
return lastname; 
} 
//-------------------
public void changeName() 
{ 
lastname= firstname+" "+lastname; 
} 

}

Please help …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:14:20+00:00Added an answer on May 25, 2026 at 10:14 am

    The bean pointed to by #{player} has not been initialized properly, so the #{player.lastname} throws a NullPointerException.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting Following Exception while configuring the Connection Pool in Tomcat This is
hi i am getting the following exception while running my application and my applicationContext.xml
I'm getting the following exception when I run my application in Release mode from
I am getting the following exception when trying to run my jar through java
While using a third party dll I was getting the following exception: exePath must
While building the android app using ant am getting the following exception. Couldn't figure
I am getting he following Exception while running my Quartz Schdular program. Below is
I am getting the following exception while adding data into database: org.hibernate.HibernateException: The database
I am getting the following exception message when I try to run my newly
I am getting following exception while running BIRT from a Linux OS. Caused by:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.