Wrapped java.lang.Exception on iReport's Image Field

download/file.php?mode=view&id=2726

I am getting a “Wrapped java.lang.Exception” whenever I pass a field in a foundset (which is an absolute url like http://www.google.com/intl/en_ALL/images/srpr/logo1w.png) to an Image Expression placeholder ($F{shop_logo})(see attached snapshot) of an image field in my report. I am using iReport 3.7.1. My Servoy plugins folder has also been updated with the jasperreports-3.7.1.jar, commons-beanutils-1.8.2.jar from my iReport 3.7.1 and the servoy_jasperreports.jar.jnlp in my Servoy plugins folder has also been accordingly updated. I am also using servoy_jasperreports.jar ( Servoy Jasper Reports Plugin Version 3.1.0 beta 3 JAR, from http://code.google.com/p/servoy-jasperr … r&can=2&q=)

I have other fields in my report and they all display the fields (string fields) passed to them from my Servoy foundset. The only iReport field in my report template that throws an error is where the image field is concern. When I replace $F{shop_logo} direct with the string http://www.google.com/intl/en_ALL/images/srpr/logo1w.png for instance in iReport, the report runs well from Servoy with no errors. I found out that the error was not even the string http://www.google.com/intl/en_ALL/images/srpr/logo1w.png that I have been passing from my foundset to my iReport, for I when I pass an just an empty string(“”) to $F{shop_logo} in my report from Servoy, I still get an “Wrapped java.lang.Exception” error.

Can somebody show me what I may be missing?

The following the Servoy error log when the above error occurs:

org.mozilla.javascript.WrappedException: Wrapped java.lang.Exception (C:\Users\MyComputerName\servoy_workspace_5_1_4\MySolutionName\forms\myServoyForm.js#869) 
     at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828) 
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199) 
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353) 
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666) 
     at script.onPrint(C:\Users\MyComputerName\servoy_workspace_5_1_4\MySolutionName\forms\myServoyForm.js:869) 
     at script.svy_nav_dc_print(C:\Users\MyComputerName\servoy_workspace_5_1_4\svy_nav_navigation\globals.js:845) 
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166) 
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) 
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165) 
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196) 
     at com.servoy.j2db.scripting.Zub.executeFunction(Zub.java:97) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:741) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:1223) 
     at com.servoy.j2db.Zcc.Za(Zcc.java:1) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16) 
     at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:2) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.Component.processMouseEvent(Unknown Source) 
     at javax.swing.JComponent.processMouseEvent(Unknown Source) 
     at java.awt.Component.processEvent(Unknown Source) 
     at java.awt.Container.processEvent(Unknown Source) 
     at java.awt.Component.dispatchEventImpl(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Window.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.EventQueue.dispatchEvent(Unknown Source) 
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.run(Unknown Source) 
    Caused by: java.lang.Exception 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.runReport(JasperReportsProvider.java:522) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:305) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:302) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
     at java.lang.reflect.Method.invoke(Unknown Source) 
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179) 
     ... 38 more

On the line 869 of my script, I call Jasperreport as :

plugins.jasperPluginRMI.runReport(MyFoundset, ‘MyJasperReport.jrxml’, null, ‘view’, null, null);

and

net.sf.jasperreports.engine.JRException 
     at com.servoy.plugins.jasperreports.JasperReportRunner.getJasperPrint(JasperReportRunner.java:308) 
     at com.servoy.plugins.jasperreports.JasperReportRunner.getJasperPrint(JasperReportRunner.java:111) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.runReport(JasperReportsProvider.java:383) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:305) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:302) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
     at java.lang.reflect.Method.invoke(Unknown Source) 
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179) 
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353) 
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666) 
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166) 
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) 
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165) 
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196) 
     at com.servoy.j2db.scripting.Zub.executeFunction(Zub.java:97) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:741) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:1223) 
     at com.servoy.j2db.Zcc.Za(Zcc.java:1) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16) 
     at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:2) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.Component.processMouseEvent(Unknown Source) 
     at javax.swing.JComponent.processMouseEvent(Unknown Source) 
     at java.awt.Component.processEvent(Unknown Source) 
     at java.awt.Container.processEvent(Unknown Source) 
     at java.awt.Component.dispatchEventImpl(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Window.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.EventQueue.dispatchEvent(Unknown Source) 
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.run(Unknown Source)

and

java.lang.NullPointerException 
     at net.sf.jasperreports.engine.util.JRLoader.loadBytes(JRLoader.java:329) 
     at net.sf.jasperreports.engine.util.JRLoader.loadBytesFromLocation(JRLoader.java:467) 
     at net.sf.jasperreports.engine.JRImageRenderer.getInstance(JRImageRenderer.java:176) 
     at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:944) 
     at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:891) 
     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:2011) 
     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:749) 
     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:252) 
     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110) 
     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:923) 
     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) 
     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:85) 
     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624) 
     at com.servoy.plugins.jasperreports.JasperReportRunner.getJasperPrint(JasperReportRunner.java:301) 
     at com.servoy.plugins.jasperreports.JasperReportRunner.getJasperPrint(JasperReportRunner.java:111) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.runReport(JasperReportsProvider.java:383) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:305) 
     at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:302) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
     at java.lang.reflect.Method.invoke(Unknown Source) 
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179) 
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353) 
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666) 
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166) 
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) 
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165) 
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196) 
     at com.servoy.j2db.scripting.Zub.executeFunction(Zub.java:97) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:741) 
     at com.servoy.j2db.Zwb.Za(Zwb.java:1223) 
     at com.servoy.j2db.Zcc.Za(Zcc.java:1) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16) 
     at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:2) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.Component.processMouseEvent(Unknown Source) 
     at javax.swing.JComponent.processMouseEvent(Unknown Source) 
     at java.awt.Component.processEvent(Unknown Source) 
     at java.awt.Container.processEvent(Unknown Source) 
     at java.awt.Component.dispatchEventImpl(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Window.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.EventQueue.dispatchEvent(Unknown Source) 
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.run(Unknown Source)

Hi,

Please make a case for this in our support system and provide a small sample solution, along with a jrxml report file, where the indicated issue shows up.

Regards,
Andrei

Hi Andrei,
Thanks for the feedback.
We found a workaround this image-url field (from Servoy foundset) throwing an error “Wrapped java.lang.Exception” when “plugins.jasperPluginRMI.runReport(MyFoundset, ‘MyJasperReport.jrxml’, null, ‘view’, null, null)” is called from Servoy - That image-url field was defined as a parameter, say, myParam like :

.
.
var myParam = new java.util.HashMap();
myParam.put('shop_logo', '');
.
.
.

and then passed as

.
.

plugins.jasperPluginRMI.runReport(MyFoundset, 'MyJasperReport.jrxml', null, 'view', myParam, null)
.
.

Thus final code look something like :

.
.
var myParam = new java.util.HashMap();
myParam.put('shop_logo', '');
.
.
.
.
.

plugins.jasperPluginRMI.runReport(MyFoundset, 'MyJasperReport.jrxml', null, 'view', myParam, null)
.
.

having changed the corresponding element’s property in my iReport template from a ‘field’ (iReport>Report inspector>Fields) to a ‘parameter’ (iReport>Report inspector>Parameters). This got it working :D .

On the other hand, I discovered something else - the report-pdf generated when I run my report from Servoy, seems to use 2 different fonts depending on whether is run from a smartclient or webclient. I have (Jasperreport Barbeque)barcodes being generated as part of my report. When my report is run in a smartclient, the human-readable part of the barcodes apear - these are however missing in the webclient version.

What is the expected output? The report-pdf should have the same look-and-feel in both Servoy clients.

Is there a workaround this?

Regards,

Hi Bob,

We could not reproduce this with the latest version of the plugin. Could you please attach the report in which you use barcodes or file a case with our support system (attaching a sample solution and a sample report in which this is reproducible)?

Regards,
Andrei

Hi Andrei,

Maybe I am using a different version of “servoy_jasperreports.jar” than you have. My version is this one: http://code.google.com/p/servoy-jasperr … r&can=2&q=

Suppose we are using the same version, please let me know so that I can go ahead and file a case as suggested. On the other hand if you have a more actual “servoy_jasperreports.jar” version than the one I am using, maybe that resolves the font issue and we’d be glad to try that out.

See the attachment for a sample of my report-pdf generated report from Servoy. The left column is the pdf generated using a webclient and the right column is the same report, generated from a smartclient (XXXXX.jnlp).

As I indicated earlier, the pdf fonts are different in both cases, the human readable part of the barcode for instance, is completely missing in the webclient version.

Thanks for the support.

Hi Bob,

Please file a case on this. Barcodes and fonts should work, in the configuration of version 3.1.0 b3, so this indeed sounds like an issue.
Also, please attach a sample report and a Servoy solution with the case, pointing out, if possible, the configuration of libraries you used the plug-in too (the barcodes/barbeque libs used).

Best regards,
Andrei

Thanks, Andrei. Will file a case asap with a sample solution.

Case 321298 is filed for the above issue.