Exception(s) when trying to debug a birt report
Asked Answered
S

3

5

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?

Sherburn answered 10/5, 2011 at 7:45 Comment(0)
A
8

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.

Angeles answered 24/10, 2011 at 12:27 Comment(0)
M
4

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! :-)

Mun answered 10/5, 2011 at 19:29 Comment(0)
I
0

I agree with Harrys solution.

The root cause is that the fallback to the configured temp folder is only evaluated if a Debug Configuration has been created in Eclipse. If a Debug Configuration was added for that report, the pre-filled Temp Folder works well (user's temp folder). Just create a Debug Configuration without modifying anything, and it works.

If NO Debug Configuration is present for that report, Eclipse is not using the default mentioned above. This is the bug.

Indican answered 7/12, 2016 at 15:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.