gpt4 book ai didi

jar - 仅在 EAR 网页中使用 WebLogic 的 JDeveloper 11.1 中的 Jasper 报告 "package net.sf.jasperreports.engine does not exist"异常

转载 作者:行者123 更新时间:2023-12-01 11:33:42 25 4
gpt4 key购买 nike

我正在使用 JDeveloper 11.1、Oracle 11 和 TIBCO JasperReports 6.0.1。

我在尝试从我的网页 (ViewController) 生成 Jasper Reports 时遇到问题,同时使用 ApplicationModule (Model - EJB) 来执行此操作。最后,PDF 文件必须通过电子邮件发送,这就是我将其放入模型项目的原因。

如果我执行 ApplicationModule,它工作正常,没有异常,PDF 生成和发送非常好。

但是,如果我从一个网页开始执行客户端方法,我会得到这个异常:

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:4: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:5: package net.sf.jasperreports.engine.fill does not exist
import net.sf.jasperreports.engine.fill.*;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:18: cannot find symbol
symbol: class JREvaluator
public class Simple_Blue_1429546047623_56582 extends JREvaluator
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:25: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_REPORT_LOCALE = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:26: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_Description = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:27: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_JASPER_REPORT = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:28: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_REPORT_VIRTUALIZER = null;
^

我只是粘贴一个片段。

我正在使用其他 .jars 作为 POI,用于读取 .xlsx 文件然后插入数据库,所以我不知道为什么我可以毫无问题地访问 POI 但同时我没有可用的 Jasper Reports .

我已经在网上搜索了一些解决方案,但没有解决我的问题。我得到了一些关于 jdt-compiler 的信息,但我没有在 JasperReports 套件中找到它。我的项目真的是一堆乱七八糟的库,也许是我遗漏了或添加了太多库?

目前我的EAR项目是这样的:

EAR project

EAR\lib:

EAR\lib contents

这是 jars 设置或类似问题的一种问题。我已经找到了这个页面,但它真的很奇怪,我不认为我的问题有那么复杂。

http://docs.oracle.com/cd/E25178_01/fusionapps.1111/e15524/adv_wls_e.htm

编辑 1:

我尝试使用这段代码查看我的类路径:

ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for (URL url: urls) {
logger.info(String.format("Classpath: %s.", url.toString()));
}

我得到了这个输出。 POI 不在这里,但为什么,我使用它没有任何问题,而我不能使用 JasperReports?

1) WebLogic 10.3 基本安装中默认使用 POI.jar 吗? 没有

编辑 2:

我发现在 WebLogic 中访问 weblogic.utils.classloaders.GenericClassLoader 是必要的,它向我发送属于此 EAR 应用程序的所有库。使用它,可以使用 Jasper Reports,但是我不知道如何才能成功访问它们...

GenericClassLoader jre = (GenericClassLoader) JREvaluator.class.getClassLoader();
logger.info(String.format("jre: %s, s.", jre, jre.getClassPath()));

非常感谢,

最佳答案

好吧,正如有人所说,有必要使用 jdt-compiler-3.1.1.jar。我将它添加到 /lib 文件夹,现在它可以正常工作了。

很奇怪TIBCO Jasper Reports 6.0.0的安装包里没有这个.jar,其实我一直下到JR 3.7.6这是最低版本。该文件来自28/12/2008...

很好...

关于jar - 仅在 EAR 网页中使用 WebLogic 的 JDeveloper 11.1 中的 Jasper 报告 "package net.sf.jasperreports.engine does not exist"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29753457/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com