Jump to content

error while filling jasper report for date columns


subeshvasu

Recommended Posts

Pls see the below logs , for DOJ - date of joining. I have one class Multidatsource which implements JRdatasource, It has a method   Object getField() {   }  .. 

Basically jasper   fills the report  by calling this method. Jasper is able to fetch all the records , But during filling if it encounters a date field. It gets a classcastException   java.sql.date.   

  But in I-report  , the date column property is having only java.sql.TimeSTamp, java.sql.Timeava.util.date..

Pls tell me why iam getting this exception, when jasperserver fills a report with date fields. ? To figure out below is my log exceptions.

16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:106 - Result value0->{SAL=2000, DOJ=2008-06-10, ENAME=Anish, ENO=107}
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapSAL = 2000
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapDOJ = 2008-06-10
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENAME = Anish
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENO = 107
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:106 - Result value1->{SAL=4000, DOJ=2008-05-10, ENAME=Satya, ENO=108}
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapSAL = 4000
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapDOJ = 2008-05-10
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENAME = Satya
16:53:21,265  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENO = 108
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:106 - Result value2->{SAL=3000, DOJ=2009-05-10, ENAME=subesh, ENO=101}
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapSAL = 3000
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapDOJ = 2009-05-10
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENAME = subesh
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENO = 101
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:106 - Result value3->{SAL=4000, DOJ=2009-12-10, ENAME=ramesh, ENO=102}
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapSAL = 4000
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapDOJ = 2009-12-10
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENAME = ramesh
16:53:21,281  WARN MultiDataSourceQueryExecuter,http-9080-Processor25:111 - MapENO = 102
16:53:21,968  WARN MultiDataBaseDataSource,http-9080-Processor25:55 - position ->0-> size ->4
16:53:21,968  WARN MultiDataBaseDataSource,http-9080-Processor25:38 - Field ->java.math.BigDecimal|class net.sf.jasperreports.engine.fill.JRFillField|class java.math.BigDecimal -> value107
16:53:21,968  WARN MultiDataBaseDataSource,http-9080-Processor25:39 - encoding usedUTF8
16:53:21,968  WARN MultiDataBaseDataSource,http-9080-Processor25:38 - Field ->java.lang.String|class net.sf.jasperreports.engine.fill.JRFillField|class java.lang.String -> valueAnish
16:53:21,968  WARN MultiDataBaseDataSource,http-9080-Processor25:39 - encoding usedUTF8
16:53:21,984  WARN MultiDataBaseDataSource,http-9080-Processor25:38 - Field ->java.sql.Timestamp|class net.sf.jasperreports.engine.fill.JRFillField|class java.sql.Timestamp -> value2008-06-10
16:53:21,984  WARN MultiDataBaseDataSource,http-9080-Processor25:39 - encoding usedUTF8
16:53:21,984  WARN MultiDataBaseDataSource,http-9080-Processor25:42 - Entered timestamp logic
16:53:22,031 ERROR JSErrorPage_jsp,http-9080-Processor25:349 -
java.lang.ClassCastException: java.sql.Date
 at com.jaspersoft.poc.db.multiDatasource.MultiDataBaseDataSource.getFieldValue(MultiDataBaseDataSource.java:43)
 at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:807)
 at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:771)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1413)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:899)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:821)
 at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
 at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:628)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillQueryReport(EngineServiceImpl.java:785)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:750)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:367)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.executeReport(EngineServiceImpl.java:876)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.domain.impl.ReportUnitRequest.execute(ReportUnitRequest.java:60)
 at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.execute(EngineServiceImpl.java:301)
 at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:329)
 at com.jaspersoft.jasperserver.war.action.ViewReportAction.verifyData(ViewReportAction.java:222)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.springframework.webflow.util.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:103)
 at org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:136)
 at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:203)
 at org.springframework.webflow.engine.AnnotatedAction.execute(AnnotatedAction.java:142)
 at org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:61)
 at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:180)
 at org.springframework.webflow.engine.State.enter(State.java:200)
 at org.springframework.webflow.engine.Transition.execute(Transition.java:229)
 at org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)
 at org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)
 at org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:207)
 at org.springframework.webflow.engine.impl.FlowExecutionImpl.signalEvent(FlowExecutionImpl.java:214)
 at org.springframework.webflow.executor.FlowExecutorImpl.resume(FlowExecutorImpl.java:238)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
 at org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:66)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
 at $Proxy22.resume(Unknown Source)
 at org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:115)
 at org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:170)
 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at com.jaspersoft.jasperserver.war.common.UploadMultipartFilter.doFilter(UploadMultipartFilter.java:86)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
 at org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter.doFilter(SwitchUserProcessingFilter.java:335)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.ji.license.JILicenseFilter.doFilter(JILicenseFilter.java:107)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.jasperserver.api.metadata.user.service.impl.MetadataAuthenticationProcessingFilter.doFilter(MetadataAuthenticationProcessingFilter.java:142)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.jasperserver.war.util.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:97)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.jasperserver.multipleTenancy.MTBasicProcessingFilter.doFilter(MTBasicProcessingFilter.java:182)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:178)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:178)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
 at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
 at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:70)
 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)
 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...