title: java.lang.NumberFormatException: For input string: "id" for Hibernate
body: <p>I want to pass the join query results from controller to view , but I am getting
  error "java.lang.NumberFormatException: For input string: "id" </p>
  
  <p>I have already go through the duplicated questions and applied the solutions for my scenario but it is not getting successful.
  <a href="https://stackoverflow.com/questions/27803379/exception-numberformatexception-for-input-string-in-jsp-list-page">Duplicated Question -1</a> <a href="https://stackoverflow.com/questions/35413698/employee-id-from-list-in-jsp-throws-java-lang-numberformatexception-for-inpu?noredirect=1&amp;lq=1">Duplicated Question -2</a> <a href="https://stackoverflow.com/questions/14858435/java-lang-numberformatexception-for-input-string-in-jsp-page?noredirect=1&amp;lq=1">Duplicated Question -3</a></p>
  
  <p>DAO code </p>
  
  <pre><code>  public  List&lt;Object [] &gt;  showEmployee_Role(){
  
      try {
  
            Session session=HibernateUtil.getSessionFactory().openSession();
            SQLQuery query = session.createSQLQuery("select e.id as eid , r.id as rid , e.ename , e.enumber , r.description from employee_profile e  INNER JOIN role r ON (e.role_id = r.id)"); 
  
            List &lt;Object []&gt; employee_role =query.list();
            return employee_role;
  
      } catch (Exception e) {
  
         System.out.println("Error in Show Employee_Role"+e.getMessage()); 
      }
  
      return null;
  
  }
  </code></pre>
  
  <p>Controller Code</p>
  
  <pre><code>        List&lt;Object []&gt;showEmployee_role=employeeDaoImpl.showEmployee_Role();
          request.setAttribute("employeeList", showEmployee_role);
          RequestDispatcher rd = request.getRequestDispatcher("EmployeeView.jsp");
          rd.forward(request, response);
  </code></pre>
  
  <p>View Code</p>
  
  <pre><code>    &lt;c:forEach  items="${employeeList}" var="emp"&gt;
  
        &lt;tr&gt;  
         &lt;td&gt; ${emp.id} &lt;/td&gt; 
         &lt;td&gt; ${emp.ename} &lt;/td&gt; 
         &lt;td&gt; ${emp.enumber}&lt;/td&gt; 
         &lt;td&gt; ${emp.description}&lt;/td&gt; 
       &lt;/tr&gt;
      &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Employee Entity </p>
  
  <pre><code>@Entity(name="employee_profile")
  public class Employee  implements Serializable{
  
  
  private int id;
  private String ename;
  private String enumber;
  private Role role;
  private Collection &lt;Task&gt; task;
  
  
  
  public Employee() {
  
  }
  
  
  public Employee(String ename,String enumber,Role role){
  
      this.ename=ename;
      this.enumber=enumber;
      this.role=role;  
  }
  
  @Id @GeneratedValue
  @Column(name="id")
   public int getId() {
      return id;
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  public String getEname() {
      return ename;
  }
  
  public void setEname(String ename) {
      this.ename = ename;
  }
  
  public String getEnumber() {
      return enumber;
  }
  
  public void setEnumber(String enumber) {
      this.enumber = enumber;
  }
  
  @OneToOne(cascade = CascadeType.ALL)
  @JoinColumn(name = "role_id")
  public Role getRole() {
      return role;
  }
  
  public void setRole(Role role) {
      this.role = role;
  }
  
  
  
  @OneToMany(cascade=CascadeType.ALL)
  @JoinTable(
          name="employee_task",
          joinColumns=@JoinColumn(name="eid"),
          inverseJoinColumns=@JoinColumn(name="tid")
  )
  public Collection&lt;Task&gt; getTask() {
      return task;
  }
  
  public void setTask(Collection&lt;Task&gt; task) {
      this.task = task;
  }}
  </code></pre>
  
  <p>Role Entity</p>
  
  <pre><code>@Entity(name="role")
  public class Role implements Serializable{
  
  
  @Id @GeneratedValue
  @Column(name="id")
  private int id;
  
  private String title;
  private String description;
  
  
  public int getId() {
      return id;
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  public String getTitle() {
      return title;
  }
  
  public void setTitle(String title) {
      this.title = title;
  }
  
  public String getDescription() {
      return description;
  }
  
  public void setDescription(String description) {
      this.description = description;
  }
  
  
  }
  </code></pre>
  
  <p>Stack trace</p>
  
  <pre><code>Info:   Hibernate: select role0_.id as id1_2_, role0_.description as descript2_2_, role0_.title as title3_2_ from role role0_
  Info:   Hibernate: select task0_.id as id1_3_, task0_.tname as tname2_3_ from task task0_
  Info:   Hibernate: select employee0_.id as col_0_0_ from employee_profile employee0_ inner join role role1_ on employee0_.role_id=role1_.id
  Info:   Hibernate: select e.id as eid , r.id as rid , e.ename , e.enumber , r.description from employee_profile e  INNER JOIN role r ON (e.role_id = r.id)
  Info:   Hibernate: select role0_.id as id1_2_, role0_.description as descript2_2_, role0_.title as title3_2_ from role role0_
  Info:   Hibernate: select task0_.id as id1_3_, task0_.tname as tname2_3_ from task task0_
  Warning:   Servlet.service() for servlet jsp threw exception
  java.lang.NumberFormatException: For input string: "id"
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  at java.lang.Integer.parseInt(Integer.java:580)
  at java.lang.Integer.parseInt(Integer.java:615)
  at javax.el.ArrayELResolver.toInteger(ArrayELResolver.java:378)
  at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:198)
  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188)
  at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
  at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
  at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
  at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1016)
  at org.apache.jsp.EmployeeView_jsp._jspx_meth_c_forEach_0(EmployeeView_jsp.java:297)
  at org.apache.jsp.EmployeeView_jsp._jspService(EmployeeView_jsp.java:125)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:575)
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:546)
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:428)
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:378)
  at Controller.EmployeeController.doPost(EmployeeController.java:214)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
  at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
  at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
  at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
  at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
  at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
  at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
  at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
  at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
  at java.lang.Thread.run(Thread.java:748)
  </code></pre>