0 Replies Latest reply on Nov 1, 2008 11:26 AM by Nanda Kishore

    Error while accessing access entity beans in jboss 5.0.0 CR2

    Nanda Kishore Newbie

      Hi when i am trying to access entity beans i am getting the following error in this line.

      Temperature c = (Temperature)(temp1).get(i);




      org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 169
      
      166: temp1= currentSession.findAll();
      167:
      168: for (int i = 0; i < temp1.size(); i++) {
      169: Temperature temp = (Temperature)(temp1).get(i);
      170: /* SimpleDateFormat dateformatMMDDYYYY = new SimpleDateFormat("MM:dd:yyyy");
      171: SimpleDateFormat t = new SimpleDateFormat("HH:mm:ss");
      
      
      
      Stacktrace:
       org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      
      root cause
      
      java.lang.ClassCastException: com.TemperatureEntityBeans.Temperature
       org.apache.jsp.index_jsp._jspService(index_jsp.java:233)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



       <%@ page import="com.TemperatureSessionBeans.*"%>
      <%@ page import="com.TemperatureEntityBeans.Temperature"%>
      
      
      for (int i = 0; i < temp1.size(); i++) {
       Temperature c = (Temperature)(temp1).get(i);
       }