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


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:
---Beandisplay.java---
package uordisplay;
import org.displaytag.decorator.TableDecorator;
public class Beandisplay extends TableDecorator{

      private String img;

 /**
 * getter methods
 *
 */
 public Beandisplay(){
 }
 public Beandisplay(String img){
       this.img=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){
       this.img=img;
 }

}

<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
  <jsp:directive.page 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();
      list.add(bd[0]);
                list.add(bd[1]);
                list.add(bd[2]);
                list.add(bd[3]);
                list.add(bd[4]);
                list.add(bd[5]);
                list.add(bd[6]);
      session.setAttribute("lister",list);
 %>
      <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"       
      </display:table>
      </center>



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
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
      org.apache.jsp.Uordisplay_jsp._jspService(org.apache.jsp.Uordisplay_jsp:105)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

muraliAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
Hi,

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.

regards,
fargo

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.