title: Issues with the primefaces bar chart
body: <p>im trying to get the primefaces bar chart to work however i am getting the following error :</p>
  
  <pre><code>java.lang.ClassCastException: java.util.Vector cannot be cast to org.primefaces.model.chart.CartesianChartModel
  
  
  WARNING:   StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
  java.lang.ClassCastException: java.util.Vector cannot be cast to org.primefaces.model.chart.CartesianChartModel
      at org.primefaces.component.chart.bar.BarChartRenderer.encodeData(BarChartRenderer.java:127)
      at org.primefaces.component.chart.bar.BarChartRenderer.encodeScript(BarChartRenderer.java:51)
      at org.primefaces.component.chart.bar.BarChartRenderer.encodeEnd(BarChartRenderer.java:36)
  </code></pre>
  
  <p>here is the code:</p>
  
  <pre><code>        &lt;p:barChart id="basic" value="#{markingBean.studentsMarks}" legendPosition="ne"  
                      title="Basic Bar Chart" min="0" max="200" style="height:300px"/&gt;
  </code></pre>
  
  <p>the studentsMarks is retrieved from a backing bean that does a db query</p>
  
  <pre><code>        studentsMarks = markingFacade.getMarksForStudent(markToEdit);
  </code></pre>
  
  <p>and the db query to get the 13 marks i need :</p>
  
  <pre><code>  public List getMarksForStudent(Marking id) {
      System.out.println("In getMarksForStudent");
      System.out.println("id = " + id);
      System.out.println("id = " + id.getId());
      Query m = em.createQuery("SELECT m.markSectionOne, m.markSectionTwo, m.markSectionThree, m.markSectionFour, m.markSectionFive, m.markSectionSix, m.markSectionSeven, m.markSectionEight, m.markSectionNine, m.markSectionTen, m.markSectionEleven, m.markSectionTwelve, m.markSectionThirteen FROM MARKING m WHERE m.id = :id", Double.class);
      m.setParameter("id", id.getId()); // Note the getId()
      System.out.println(m);     
      return m.getResultList();
  
  }
  </code></pre>
  
  <p>what is causing the error and how can i fix it ?</p>
  
  <p>Thanks guys :)</p>