title: Issue rendering JPQL custom query results into a JSF page
body: <p>I have an entity with the following named query:</p>
  
  <pre><code>@NamedQuery(name = "findAllGarbage", query = "SELECT g.filename, g.description, g.uploadDate FROM Garbage g;")
  </code></pre>
  
  <p>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.</p>
  
  <p>This is how the rest of the program looks like:</p>
  
  <p>-The EJB that executes the query</p>
  
  <pre><code>@Stateless(name = "ejbs/SearchEJB")
  public class SearchEJB implements ISearchEJB {
  
  @PersistenceContext
  private EntityManager em;
  
  
  public List&lt;Garbage&gt; findAllGarbage() {
      Query query = em.createNamedQuery("findAllGarbage");    
      List&lt;Garbage&gt; tmpGarbage = query.getResultList();
      return tmpGarbage;
  }
  </code></pre>
  
  <p>-The part of the JSF that displays the tableData:</p>
  
  <pre><code>&lt;p:dataTable var="garbage" value="#{resultsController.allGarbage}" paginator="true" rows="10"  
               paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
               rowsPerPageTemplate="5,10,15"&gt;         
  
              &lt;p:column&gt;  
              &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="Filename" /&gt;  
              &lt;/f:facet&gt;  
              &lt;h:outputText value="#{garbage.filename}" /&gt;
               &lt;/p:column&gt; 
  
              &lt;p:column&gt;  
              &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="Description" /&gt;  
              &lt;/f:facet&gt;  
              &lt;h:outputText value="#{garbage.description}" /&gt;  
               &lt;/p:column&gt; 
  
              &lt;p:column&gt;  
              &lt;f:facet name="header"&gt;  
              &lt;h:outputText value="Upload date" /&gt;  
              &lt;/f:facet&gt;  
              &lt;h:outputText value="#{garbage.uploadDate}" /&gt; 
               &lt;/p:column&gt;                
      &lt;/p:dataTable&gt; 
  </code></pre>
  
  <p>-The managed bean that interacts with the JSF page:</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public class ResultsController {
  
  @EJB
  private ISearchEJB searchEJB;
  
  private Garbage garbage;
  
  public List&lt;Garbage&gt; getAllGarbage() {
      return searchEJB.findAllGarbage();
  }
  
  public Garbage getGarbage() {
      return garbage;
  }
  
  public void setGarbage(Garbage garbage) {
      this.garbage = garbage;
  }
  </code></pre>
  
  <p>The error says:</p>
  
  <blockquote>
    <p>WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.NumberFormatException: For input string: "filename"</p>
  </blockquote>
  
  <p>I dont understand what is wrong with the file name.</p>
  
  <p>------------------------------------UPDATE------------------------------------</p>
  
  <p>I changed the JSF to this, and now i dont see the error. I see tha table data but empty:</p>
  
  <pre><code>&lt;p:dataTable var="garbage" value="#{resultsController.allGarbage}" paginator="true" rows="10"  
           paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
           rowsPerPageTemplate="5,10,15"&gt;         
  
          &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
          &lt;h:outputText value="Filename" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{garbage[4]}" /&gt;
           &lt;/p:column&gt; 
  
          &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
          &lt;h:outputText value="Description" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{garbage[3]}" /&gt;  
           &lt;/p:column&gt; 
  
          &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
          &lt;h:outputText value="Upload date" /&gt;  
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{garbage[6]}" /&gt; 
           &lt;/p:column&gt;                
  &lt;/p:dataTable&gt; 
  </code></pre>