【问题标题】:Exception(s) when trying to debug a birt report尝试调试 birt 报告时出现异常
【发布时间】:2011-05-10 07:45:18
【问题描述】:

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

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

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

【问题讨论】:

    标签: eclipse debugging exception birt


    【解决方案1】:

    我按照建议做了:

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

    我将“临时文件夹”条目更改为我的 Windows 用户帐户之外的目录(即 C 驱动器下的某个目录,例如:C:\Temp\Birt)。我创建了指定的目录。

    然后 Eclipse 调试工作。

    【讨论】:

      【解决方案2】:

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

      异常的原因是文件路径是绝对的,并试图将临时文件保存在 / 中,它没有写权限。一种解决方法是简单地创建文件(在您的情况下是 /StandardOCE_PRS2_OperatorProductivity.rptdesign.html。我假设您在 Linux 上)并使其可由运行 Eclipse 的用户写入。这会让你克服这个错误,但在那之后我又得到了另一个,所以这对我来说不是一个好的解决方案。我认为这显然是 BIRT 插件中的一个错误,因为它应该为此使用 /tmp。甚至好像是在Debug Configuration中配置的,但是并没有使用。

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

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

      【讨论】:

        【解决方案3】:

        我同意 Harry 的解决方案。

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

        如果该报告NO Debug Configuration 存在,则Eclipse 未使用上述默认设置。这是错误。

        【讨论】:

          猜你喜欢
          • 2016-03-16
          • 1970-01-01
          • 2012-09-10
          • 1970-01-01
          • 1970-01-01
          • 2015-08-23
          • 1970-01-01
          • 2020-05-28
          • 1970-01-01
          相关资源
          最近更新 更多