[jboss-user] [EJB 3.0] - Help on java.lang.ClassCastException: java.lang.String

scout1lacno do-not-reply at jboss.com
Thu Oct 19 01:37:55 EDT 2006


Hi,

Hi all im having an error java.lang.ClassCastException: java.lang.String

Does anyone have an idea on this error?

My codes are:

  |  TblCountryFacadeLocal myCountryBean = lookupTblCountryFacade();
  |         List myList = myCountryBean.findAll(); 
  |         int length = myList.size();
  | 
  |  for (int i = 0; i < length; i++) {
  | 		TblCSCSubCategory region = (TblCSCSubCategory) myList.get(i) ;
  |                 System.out.println((i + 1)+". "+region.getStrName().toString());
  | 	}

And for  my Entity code is:
 public List findAll() {
  |         return em.createQuery("select o.strCountry from TblCountry as o").getResultList();
  |     }

Hope for a kind response. 

Thankz :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979249#3979249

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979249



More information about the jboss-user mailing list