BIRT Runtime 4.6.0运行genReport时出错

时间:2016-07-05 07:20:37

标签: java eclipse reporting birt

我对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

2 个答案:

答案 0 :(得分:2)

请检查 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=497356#c1

从org.eclipse.birt.runtime_4.6.0-20160607.jar的META-INF文件夹中删除以下文件:

ECLIPSE_.RSA

ECLIPSE_.SF

答案 1 :(得分:0)

在文件夹/ var / lib / tomcat7 / webapps / birt / WEB-INF / lib中:

xlCreateXMLBook()

它将删除阻止tomcat部署birt.war文件的文件

来源:https://www.eclipse.org/forums/index.php/t/1078982/