This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Query query=em.createQuery("SELECT U.firstname from User U");
List list = query.getResultList();
Iterator iterator = list.iterator();
User emp = (User)iterator.next();
return new DefaultHttpHeaders("create");
the user is my bean .
when i m running the web application the occurs due to this line i.e User emp = (User)iterator.next();
and the error is java.lang.String cannot be cast to com.action.User
so please help me t solve the problem :