尝试调试birt报告时出现异常

时间:2011-05-10 07:45:19

标签: eclipse debugging exception birt

我想调试图表的afterDataSetFilled方法。当我开始调试时,我收到一个对话框,提示我输入所有报告参数的值(其中两个是日期时间)。无论以何种格式输入datetime参数,我总是得到以下异常:

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

我找不到有什么问题。我为报告参数输入的默认值(以yyyy-MM-dd HH:mm:ss格式)是正常的,并且报告生成正确。但是,在启动调试器时,它们以不同的格式输入(MMMM d,y h:mm:ss)。如果我这样离开他就会得到例外。如果我将它们更改为yyyy-MM-dd HH:mm:ss格式,我仍然会得到例外。这是一个已知的BIRT问题,还是我做错了什么?

我能够通过在SQL查询中对这些值进行硬编码(以及删除日期时间报告参数)来绕过此问题。但在我这样做之后,出现了另一个例外:

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

你以前遇到过这个问题吗?你有什么建议我来解决它?

3 个答案:

答案 0 :(得分:8)

我按照建议做了:

  • 更改为标准的“调试”视角
  • 在完整的“运行”菜单下,打开“调试配置”

我将“Temp Folder”条目更改为我的Windows用户帐户外的目录(即C-drive下的内容,例如:C:\ Temp \ Birt)。我创建了指定的目录。

然后Eclipse调试工作。

答案 1 :(得分:4)

我遇到了和你今天一样的FileNotFoundException,我找到了一个解决方案。

异常的原因是文件路径是绝对的,并尝试在/没有写入权限的情况下保存临时文件。解决方法是简单地创建文件(在您的情况下为/StandardOCE_PRS2_OperatorProductivity.rptdesign.html。我假设您在Linux上)并使运行Eclipse的用户可以写入该文件。这会让你超过这个错误,但我刚刚接到另一个错误,所以这对我来说不是一个好的解决方案。我认为这显然是BIRT插件中的一个错误,因为它本应该使用/ tmp。它甚至似乎在调试配置中配置,但不使用它。

然后我试图找出如何更改Debug配置。 Eclipse在Report Design透视图中隐藏了这一点,所以我感到困惑了一段时间,但如果您更改为Java透视图,您将看到Debug按钮和完整的Run菜单。从按钮或菜单打开调试配置,您将看到BIRT插件之前为您创建的配置。

如果我从那里运行它,它应该使用/ tmp目录,并且调试工作。现在您还可以使用调试配置。可能有用! : - )

答案 2 :(得分:0)

我同意Harrys解决方案。

根本原因是,只有在Eclipse中创建了调试配置时,才会评估已配置的临时文件夹的回退。如果为该报告添加了调试配置,则预填充的临时文件夹工作正常(用户的临时文件夹)。只需创建一个调试配置而不修改任何东西,它就可以工作。

如果该报告没有调试配置,则Eclipse不使用上面提到的默认值。这就是错误。