Unable to load uordisplay.Beandisplay due to a java.lang.InstantiationException exception

Posted on 2006-03-31
Last Modified: 2010-08-05

Hi.. , I am working with the display tag.
While i am using the decoraters with  the display tag i am getting the Exception
like: Unable to load uordisplay.Beandisplay due to a java.lang.InstantiationException exception

Can any body help me  to come out of this error.

        My package is:uordisplay.  
        My Bean is:Beandisplay
        My jsp page is:Uordisplay.

my code is:
package uordisplay;
import org.displaytag.decorator.TableDecorator;
public class Beandisplay extends TableDecorator{

      private String img;

 * getter methods
 public Beandisplay(){
 public Beandisplay(String img){


 public String getImage(){
            Beandisplay lobj = (Beandisplay)getCurrentRowObject();      
            return "&lt;a href=\""+">"+ "<img src = '"+lobj.getImage()+"'  width='100' height='100'/>"+"</a>";


 *setter methods

 public void setImage(String img){


<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
  < contentType="text/html; charset=UTF-8" />
<%@ page language = "java" import = "java.util.*" import = "uordisplay.Beandisplay"%>

  <center><h3>Auto-paging , Sorting of long lists</h3>
      Beandisplay bd[] = new Beandisplay[7];
                bd[0] = new Beandisplay("img");
      bd[1] = new Beandisplay("def");
      bd[2] = new Beandisplay("ghi");
      bd[3] = new Beandisplay("jkl");
      bd[4] = new Beandisplay("mno");
      bd[5] = new Beandisplay("poq");
      bd[6] = new Beandisplay("rst");
      ArrayList list=new ArrayList();
      <hr width=40%><br>
               <display:table  cellpadding="19" name="sessionScope.lister" pagesize="5" defaultsort="1"     defaultorder="ascending" decorator="uordisplay.Beandisplay">

            <display:column property="image" title="Car Image"       

While running  this on Tomcat I am getting the error :

javax.servlet.ServletException: Unable to load uordisplay.Beandisplay due to a java.lang.InstantiationException exception

Question by:murali
    1 Comment
    LVL 11

    Accepted Solution


    Check the get method

    public String getImage(){
              Beandisplay lobj = (Beandisplay)getCurrentRowObject();    
              return "&lt;a href=\""+">"+ "<img src = '"+lobj.getImage()+"'  width='100' height='100'/>"+"</a>";


    is something getting null here?? The instantiation exception generally occurs when the instantiation of bean methods are getting null pointer.



    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Outlook Free & Paid Tools
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now