Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception(s) when trying to debug a birt report

I want to debug the afterDataSetFilled method of a chart. When I start debugging, I am getting a dialog prompting me to enter the values of all the report parameters (two of which are datetime). No matter under which format I enter the datetime parameters, I always get the following exception:

SEVERE: Engine exception
org.eclipse.birt.report.engine.api.impl.ParameterValidationException: The type of parameter "startDate" is expected as "dateTime", not "java.lang.String".
    at org.eclipse.birt.report.engine.api.impl.EngineTask.validateParameterValueType(EngineTask.java:865)
    at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:829)
    at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:756)
    at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:686)
    at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1400)
    at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:670)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:94)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.createReport(ReportLauncher.java:594)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.renderReport(ReportLauncher.java:541)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.run(ReportLauncher.java:455)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.main(ReportLauncher.java:104)
    at org.eclipse.birt.report.debug.internal.core.ReportDebugger.start(ReportDebugger.java:39)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
May 10, 2011 10:08:11 AM org.eclipse.birt.report.debug.internal.core.vm.ReportVMServer$1 run
WARNING: [Server] client disconnected

I couldn't find what was wrong. The default values I entered (in the yyyy-MM-dd HH:mm:ss format) for the report parameters are ok, and the report is generated correctly. However, when starting the debugger they are entered under a different format (MMMM d, y h:mm:ss). If I leave them like that I get the exception. If I change them to the yyyy-MM-dd HH:mm:ss format I still get the exception. Is this a known BIRT issue, or am I doing something wrong?

I was able to bypass this issue by hard-coding these values within the SQL query (and removing the datetime report parameters). But after I did that, another exception appeared:

SEVERE: Engine exception
org.eclipse.birt.report.engine.api.EngineException: Failed to initialize emitter.
    at org.eclipse.birt.report.engine.emitter.EmitterUtil.getOuputStream(EmitterUtil.java:80)
    at org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitter.initialize(HTMLReportEmitter.java:350)
    at org.eclipse.birt.report.engine.api.impl.EngineTask.initializeContentEmitter(EngineTask.java:2044)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:117)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.createReport(ReportLauncher.java:594)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.renderReport(ReportLauncher.java:541)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.run(ReportLauncher.java:455)
    at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.main(ReportLauncher.java:104)
    at org.eclipse.birt.report.debug.internal.core.ReportDebugger.start(ReportDebugger.java:39)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.io.FileNotFoundException: /StandardOCE_PRS2_OperatorProductivity.rptdesign.html (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at org.eclipse.birt.report.engine.emitter.EmitterUtil.getOuputStream(EmitterUtil.java:75)
    ... 22 more

Have you encountered this issue before? What do you suggest I do to fix it?

like image 775
mstaniloiu Avatar asked May 10 '11 07:05

mstaniloiu


2 Answers

I did as suggested:

  • Changed to the standard 'Debug' perspective
  • Under the full 'Run' menu, opened 'Debug Configurations'

I changed the "Temp Folder" entry to a directory OUTSIDE my Windows User Account (ie something under the C-drive, say: C:\Temp\Birt). I created the specified directory.

Then Eclipse debugging worked.

like image 61
Harry Mantheakis Avatar answered Nov 19 '22 07:11

Harry Mantheakis


I ran into the same FileNotFoundException as you today and I found a solution.

The reason for the exception is that the file path is absolute and tries to save a temporary file in / where it doesn't have write permission. A workaround for this is to simply create the file (/StandardOCE_PRS2_OperatorProductivity.rptdesign.html in your case. I assume you are on Linux) and make it writable by the user that runs Eclipse. That will get you past this error, but I just got another one right after that, so this wasn't a good solution for me. I think this is obviously a bug in the BIRT plugin, as it should have used /tmp for this. It even seems to be configured in the Debug Configuration, but doesn't use it.

I then tried to find out how to change the Debug configuration. Eclipse hides this from you in the Report Design perspective so I was confused for a while, but if you change to the Java perspective you will see the Debug button and the full Run menu. Open Debug Configurations from the button or the menu and you will see the configurations that the BIRT Plugin created for you earlier.

If I then run it from there it uses the /tmp directory as it should and debugging works. And now you can also play around with the Debug Configuration. Might be useful! :-)

like image 30
ebirkenes Avatar answered Nov 19 '22 07:11

ebirkenes