users@glassfish.java.net

java.util.Vector cannot be cast to entity bean

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Fri, 16 Oct 2009 21:22:00 +0100

 

 

I am storing data in a servlet and passing it onto a jsp to display as-

 

servlet -

 

try{
                 //call the allbales method
                 baleent=baleBeanRemote.findAllBales();
                  HttpSession session = request.getSession();
                  session.setAttribute("baleent",baleent);
                  RequestDispatcher dispatcher = getServletContext()
                                               .getRequestDispatcher("/Viewdisplay.jsp");
                                               dispatcher.forward(request, response);
                                 //forward data to the DiscountItemsj.jsp to present
                                //it to user
                                dispatcher.forward(request, response);
             }
            catch(Exception ex){
   System.err.println("Can not show the all BALES page");
   }
            }
            

 

jsp -

 

<jsp:useBean id="baleent" scope="session" class="entityJB.Baleent" />
        

 

I get the following error when I ran the it -

 

[#|2009-10-16T20:05:08.673+0100|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=df9148ab-ae93-420f-a692-de1485ed727a;|ApplicationDispatcher[/KAKENTERPRISE-war] PWC1231: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: java.util.Vector cannot be cast to entityJB.Baleent
 at org.apache.jsp.Viewdisplay_jsp._jspService(Viewdisplay_jsp.java from :96)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

 

 

I went to a jsp furum for answers but nothing so far. Any Ideas why?

 

Please.

 

Thank you.

 

eve
                                                _________________________________________________________________ Chat to your friends for free on selected mobiles http://clk.atdmt.com/UKM/go/174426567/direct/01/