title: ClassCastException in implementation class
body: <p>Why am I getting the ClassCastException:</p>
  
  <p>Wrapped exception:</p>
  
  <pre><code>java.lang.ClassCastException: com.avt.model.CasePmt
      at com.avt.dao.impl.CasePmtDaoImpl.findAllCasePmt(CasePmtDaoImpl.java:68)
      at com.avt.ViewCasePmtAction.view(ViewCasePmtAction.java:127)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
      at gov.pbgc.spectrum.util.SpectrumLookupDispatchAction.execute(SpectrumLookupDispatchAction.java:113)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)    
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
  </code></pre>
  
  <p>My implementation class is</p>
  
  <pre><code>public List&lt;CasePmt&gt; findAllCasePmt() {
              List list;
              list = getHibernateTemplate().executeFind(new HibernateCallback() {
                      public Object doInHibernate(Session session)
                                      throws HibernateException, SQLException {
  
                              Query q = session
                                              .getNamedQuery("findAll");
                              return q.list();
                      }
              });
              Iterator it = list.iterator();
              List&lt;CasePmt&gt; l = new ArrayList&lt;CasePmt&gt;();
  
              CasePmt voObj;
              while (it.hasNext()) {
                      voObj = new CasePmt();
  
                      Object[] objs = (Object[]) it.next();
                      // System.out.print("\n" + objs[0].toString());
  
                      if (objs[2] != null) {
                              voObj.setCaseTxNum(objs[1].toString());
                      }
  
  
      .......................
                          }
                      l.add(voObj);
              }
              return l;
      }
  </code></pre>
  
  <p>and my action call is :</p>
  
  <pre><code>List&lt;CasePmt&gt; CsList =       
               CasePmtBo.getCaseDao().findAllCasePmt();
  </code></pre>
  
  <p>Im getting error in line 68 which is "Object[] objs = (Object[]) it.next();" line.
  Why am i getting this issue?</p>
  
  <p>Any inputs..im revisiting this today and facing the issue. </p>