【发布时间】:2016-07-05 07:20:36
【问题描述】:
我对 BIRT 很陌生。我正在尝试在BIRT Runtime 附带的命令提示符 中运行BIRT 示例。我已经在我的电脑上正确安装了 JDK 和 JRE:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)
在 Birt Runtime 根文件夹内的 runtime_readme.txt 中显示:
In order to run the BIRT engine in command you should:
1. set BIRT_HOME to the directory where BIRT Report Runtime Package is extracted.
2. enter into $BIRT_HOME/ReportEngine folder.
2. generate the report by run
genReport xxx.rptdesign
我已将系统环境变量中的 BIRT_HOME 设置为:C:\birtruntime
因此,通过相应的设置(BIRT_HOME 设置为 C:\birtruntime),我在执行 genReport:
时遇到了这个问题C:\Users\Dylan>%BIRT_HOME%\ReportEngine\genReport "samples\hello_world.rptdesign"
C:\Users\Dylan>ECHO off
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.misc.JarIndex.getJarIndex(Unknown Source)
at sun.misc.URLClassPath$JarLoader$1.run(Unknown Source)
at sun.misc.URLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(Unknown Source)
at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getNextLoader(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
我在网上看了很多论坛,我找不到解决上述问题的方法。请有人指出我正确的方向吗?
下面附上genReport.bat:
ECHO off
REM org.eclipse.birt.report.engine.impl.ReportRunner Usage:
REM --mode/-m [ run | render | runrender] the default is runrender
REM for runrender mode:
REM we should add it in the end <design file>
REM --format/-f [ HTML \| PDF ]
REM --output/-o <target file>
REM --htmlType/-t < HTML \| ReportletNoCSS >
REM --locale /-l <locale>
REM --parameter/-p <"parameterName=parameterValue">
REM --file/-F <parameter file>
REM --encoding/-e <target encoding>
REM
REM Locale: default is english
REM parameters in command line will overide parameters in parameter file
REM parameter name cant include characters such as \ ', '=', ':'
REM
REM For RUN mode:
REM we should add it in the end<design file>
REM --output/-o <target file>
REM --locale /-l <locale>
REM --parameter/-p <parameterName=parameterValue>
REM --file/-F <parameter file>
REM
REM Locale: default is english
REM parameters in command line will overide parameters in parameter file
REM parameter name cant include characters such as \ ', '=', ':'
REM
REM For RENDER mode:
REM we should add it in the end<design file>
REM --output/-o <target file>
REM --page/-p <pageNumber>
REM --locale /-l <locale>
REM
REM Locale: default is english
IF not "%BIRT_HOME%" == "" GOTO runBirt
ECHO "Please set BIRT_HOME first."
GOTO end
:runBirt
SET java.io.tmpdir=%BIRT_HOME%\ReportEngine\tmpdir
SET org.eclipse.datatools_workspacepath=%java.io.tmpdir%\workspace_dtp
IF not exist %java.io.tmpdir% mkdir %java.io.tmpdir%
IF not exist %org.eclipse.datatools_workspacepath% mkdir %org.eclipse.datatools_workspacepath%
REM set the birt class path.
setlocal enabledelayedexpansion
SET BIRTCLASSPATH=%BIRT_HOME%\ReportEngine\lib\*;
REM set command
SET JAVACMD=java
set p1=%1
set p2=%2
set p3=%3
set p4=%4
set p5=%5
set p6=%6
set p7=%7
set p8=%8
set p9=%9
shift
set p10=%9
shift
set p11=%9
shift
set p12=%9
shift
set p13=%9
shift
set p14=%9
shift
set p15=%9
shift
set p16=%9
shift
set p17=%9
shift
set p18=%9
shift
set p19=%9
%JAVACMD% -cp "%BIRTCLASSPATH%" -DBIRT_HOME="%BIRT_HOME%\ReportEngine" org.eclipse.birt.report.engine.api.ReportRunner %p1% %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9% %p10% %p11% %p12% %p13% %p14% %p15% %p16% %p17% %p18% %p19%
:end
【问题讨论】:
-
你没有提到你做了什么研究。如果你还没有这样做,谷歌
SecurityException: Invalid signature file digest for Manifest main attributes——有很多点击,其中之一可能会解决你的问题。 SO上有几个点击,但我不知道这是否是一个重复,所以我不会重复这个问题。 -
运行
jarsigner -verify "org.eclipse.birt.runtime-x.x.x.jar"(其中x.x.x匹配您的jar 文件)。如果失败,则说明 jar 已损坏。 -
@JimGarrison 我下载了 BIRT Runtime 的存档版本 (4.2.2) 并运行 genReport 完全没有问题。他们当前的版本似乎存在问题,而且似乎我并不是唯一遇到此问题的人。感谢您的帮助!
-
我可以说我对 BIRT 4.6.0 有同样的错误。我目前使用的 BIRT 版本没有出现这个错误:3.7.1、3.72、4.2.1、4.3.0。我的解决方法是从 org.eclibse.birt.runtime_*.jar 文件中的 META-INF 文件夹中删除所有与签名相关的文件。
标签: java eclipse reporting birt