pawel_r Posted September 14, 2009 Share Posted September 14, 2009 HiI am fetching data from Oracle database (v 9.2) into my jasprereport (v 3.6.0). When I try to put a oracle.sql.timestamp(6) field into my report I get following error:org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'oracle.sql.TIMESTAMP@b20eb8' with class 'oracle.sql.TIMESTAMP' to class 'oracle.sql.TIMESTAMP'(details below)I don't quite get the reason of the error. I changed the field type to java.sql.timestamp and I removed quotation marks added by iReport. Anyone has faced similar problem?Code:ErrorÂfillingÂprint...ÂErrorÂevaluatingÂexpressionÂ: ÂÂÂÂSourceÂtextÂ:Â$F{DataÂwejÅ›ciaÂwÂstan} net.sf.jasperreports.engine.fill.JRExpressionEvalException:ÂErrorÂevaluatingÂexpressionÂ: ÂÂÂÂSourceÂtextÂ:Â$F{DataÂwejÅ›ciaÂwÂstan} ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:193) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:570) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:538) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:868) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:368) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:353) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:256) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:482) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1423) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:725) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:272) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:908) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:811) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:59) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) ÂÂÂÂatÂnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) ÂÂÂÂatÂcom.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:855) ÂÂÂÂatÂorg.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) ÂÂÂÂatÂorg.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) CausedÂby:Âorg.codehaus.groovy.runtime.typehandling.GroovyCastException:ÂCannotÂcastÂobjectÂ'oracle.sql.TIMESTAMP@b20eb8'ÂwithÂclassÂ'oracle.sql.TIMESTAMP'ÂtoÂclassÂ'oracle.sql.TIMESTAMP' ÂÂÂÂatÂorg.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:340) ÂÂÂÂatÂorg.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:632) ÂÂÂÂatÂtabela8_1252914922122_990236.evaluate(calculator_tabela8_1252914922122_990236:339) ÂÂÂÂatÂnet.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182) ÂÂÂÂ...Â19Âmore Link to comment Share on other sites More sharing options...
Teodor Danciu Posted September 14, 2009 Share Posted September 14, 2009 Hi, What Groovy version do you use? What Oracle driver? Have you tried change the report language to Java, just so that we see if problem is related to Groovy only? Thank you,Teodor Link to comment Share on other sites More sharing options...
pawel_r Posted September 15, 2009 Author Share Posted September 15, 2009 I am using iReport (v 3.6) and in its library directory I see groovy-all-1.5.5.jar, so I assume it is versios 1.5.5 :) Changing to java generates an error, since Java doesn't allow non explicit casting from oracle.sql.timestamp to java.sql.timestamp (and unfortuantelly I am using groovy capabilities in many other places - I will prepare a separate report to check taht issue) Oracle driver is ojdbc14.jarThank you for responsePost Edited by pawel_r at 09/15/2009 08:07 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now