Casting Error with jasper report parameters migrating reports from Adempiere 3.6.1 to Idempiere 1.0.c

3,677 views
Skip to first unread message

Pedro Rozo

unread,
Aug 19, 2013, 7:03:08 PM8/19/13
to idem...@googlegroups.com
Hi everyone.

Withn our SmartPOS project (almost finishing migration) We have a simple custom jasper report (with their .jrxml and .jasper files),after the migration we are getting this error;  (see full stack at the end) 

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal

We already double checked and compared all the database tables and Active dictionary report parameter definitions and they looked the same, also we copied the report files under the reports folder without any changes (same that works in adempiere 3.6.1) and checking the code of the  internal class: JRJdbcQueryExecuter.java  looks something wrong in the casting conversion of jasper parameters, but I am not sure why my parameters are firing that Integer to BigDecimal casting exception.. the parameter definition wih the AD for this report are only:

1. C_BPartner_ID     (Integer I guess)
2. DateInvoiced          Date   (Range)

Questions

a. Is it required any other datatype conversion, data mapping or any other fix before migrated these jasper report files to the new jasper engine on Idempiere 1.0c ?  

I also enclosed the jasper report ... and here the exception stack, in case you can suggest something that we didn´t see.

Regards

Pedro Rozo


19/08/2013 05:29:55 PM org.adempiere.util.ProcessUtil startJavaProcess
SEVERE: org.compiere.report.ReportStarter
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:553)
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 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:1281)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:900)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)
at org.compiere.report.ReportStarter.startProcess0(ReportStarter.java:614)
at org.compiere.report.ReportStarter.startProcess(ReportStarter.java:345)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:172)
at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:272)
at org.adempiere.webui.apps.WProcessCtl.process(WProcessCtl.java:158)
at org.adempiere.webui.apps.ProcessDialog$ProcessDialogRunnable.doRun(ProcessDialog.java:852)
at org.adempiere.util.ContextRunnable.run(ContextRunnable.java:38)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
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:662)

insurance_customer_product.jasper
insurance_customer_product.jrxml

Ladislav Nagy

unread,
Apr 29, 2014, 11:45:14 AM4/29/14
to idem...@googlegroups.com
Hello, I'm trying to migrating custom jasper report to iDempiere, but there is some error with Integer parameter. The first problem was with BigDecimal insted of Integer in Table Direct reference. After changing it to Integer it doesn't show the report, and put one line to log:

-------------------------------
21:59:27.490===========> ReportStarter.startProcess0: ReportStarter.startProcess: Can not run report - Error evaluating expression :
    Source text : new java.lang.Integer(1) [187]

the parameter for example is AD_Org_ID,
I've try it to compile for versions 5.5, 5.1, 5.0.4, 4.6. Which is a correct version for 2.0 and https://demo.idempiere.com/webui/index.zul ?

on the demo server the same error.
sample jrxml in attachment.


Dňa utorok, 20. augusta 2013 1:13:05 UTC+2 hengsin napísal(-a):
The C_BPartner_ID is pass from iDempiere as Integer instead of BigDecimal, you need to fixed that in your jasper report. I don't remember whether that's different from what aDempiere did but integer is indeed the correct datatype for _ID field.


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

test_page.jrxml

Hiep Lq

unread,
Apr 29, 2014, 12:52:37 PM4/29/14
to idem...@googlegroups.com
version of jasper is 5.1.2
but you can use direct fle *.jrxml
I test and it work.

Ladislav Nagy

unread,
May 2, 2014, 1:04:47 PM5/2/14
to idem...@googlegroups.com
sorry, i was out of office, we have holiday here...
interesting, with simple jrxml it works.
update:
maybe the problem was with the compiled subreports, - I compiled all subreports on server  /i've add all subreports in jrxml format to provess/report, and opened it from menu/ - afrer compiling all reports on server it's now works.
i think, it was cause by java 1.8 on my computer.

Thank You for help
Laci

Dňa utorok, 29. apríla 2014 18:52:37 UTC+2 Hiep Lq napísal(-a):
Message has been deleted
Message has been deleted

Hiep Lq

unread,
May 5, 2014, 10:29:50 PM5/5/14
to idem...@googlegroups.com
good luck. your feedback is value.


On Sat, May 3, 2014 at 12:08 AM, Ladislav Nagy <ladisl...@bigware.sk> wrote:
update 2, after compiling all reports on server, it works with *.jasper too.
TY

Dňa piatok, 2. mája 2014 19:04:47 UTC+2 Ladislav Nagy napísal(-a):



--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex
Mobile: 0915277401

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam

Heng Sin Low

unread,
Aug 19, 2013, 7:13:05 PM8/19/13
to idem...@googlegroups.com
The C_BPartner_ID is pass from iDempiere as Integer instead of BigDecimal, you need to fixed that in your jasper report. I don't remember whether that's different from what aDempiere did but integer is indeed the correct datatype for _ID field.
On Tue, Aug 20, 2013 at 7:03 AM, Pedro Rozo <pedro...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages