Issue rendering JPQL custom query results into a JSF page

I have an entity with the following named query: @NamedQuery(name = "findAllGarbage", query = "SELECT g.filename, g.description, g.uploadDate FROM Garbage g;") The problem is that i want to pass that result to a dataTable to render, and i recieve NumberFormatException. I dont understand why because there are no numbers anywhere. This is how the rest of the program looks like: -The EJB that executes the query @Stateless(name = "ejbs/SearchEJB") public class SearchEJB implements ISearchEJB { @PersistenceContext private EntityManager em; public List findAllGarbage() { Query query = em.createNamedQuery("findAllGarbage"); List tmpGarbage = query.getResultList(); return tmpGarbage; } -The part of the JSF that displays the tableData: -The managed bean that interacts with the JSF page: @ManagedBean @RequestScoped public class ResultsController { @EJB private ISearchEJB searchEJB; private Garbage garbage; public List getAllGarbage() { return searchEJB.findAllGarbage(); } public Garbage getGarbage() { return garbage; } public void setGarbage(Garbage garbage) { this.garbage = garbage; } The error says: > WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception java.lang.NumberFormatException: For input string: "filename" I dont understand what is wrong with the file name. ------------------------------------UPDATE------------------------------------ I changed the JSF to this, and now i dont see the error. I see tha table data but empty:

以上就是Issue rendering JPQL custom query results into a JSF page的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准