title: JasperReports: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
body: <p>I try to use a report on my JasperServer, which I created with the help of iReport. In iReport my report works fine and there are no errors. But when I tried to deploy the report it gives me following error in short: </p>
  
  <p><code>java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date</code></p>
  
  <p>and the complete Error:</p>
  
  <pre><code>The server has encountered an error. Please excuse the inconvenience.
  
  Error Message
  java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date 
  
  Error Trace    
  java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date 
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setDate(JRJdbcQueryExecuter.java:649)
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:577)
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:399)
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter$1.visit(JRJdbcQueryExecuter.java:332)
  at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter$QueryParameter.accept(JRAbstractQueryExecuter.java:157)
  at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.visitQueryParameters(JRAbstractQueryExecuter.java:646)
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:317)
  at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:196)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.createDatasource(JRTimezoneJdbcQueryExecuter.java:168)
  at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1087)
  at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:668)
  at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1258)
  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:877)
  at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFiller.run(BaseFillHandle.java:120)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:875)
  at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:165)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:831)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1658)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
  at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>I uploaded the report, got the right data source (I tested it with another report already) and imported my Resources (Subreports) and input controls. I don't know whether I missed a step or so, but I am pretty sure that I did everything required. Importing every Subreport, setting input controls declare the right path <code>repo:mySubreports.jrxml</code>. If you need more information please tell me ! I think I added all information required and I don't want to spam SO with useless information because I don't know which information could be useful by now as well :)</p>