如何将Dynamic Jasper实施为JBoss AS 7.2静态模块?

时间:2019-04-08 02:21:07

标签: jboss7.x dynamic-jasper jboss-modules

我已经成功地将Jasper Report实现为模块,但是在实现DynamicJasper时却多次失败。

我正在尝试使用JBoss AS 7.2,Linux CentOS内核2.6.32-431.el6.x86_64和Java 1.7进行此实现

下面是我创建的module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="other.tool.dynamicJasper">
  <resources>
    <resource-root path="DynamicJasper-5.0.11.jar"/>
  </resources>
  <dependencies>
    <module name="net.sf.jasper.reports"/>
    <module name="org.apache.commons.logging" />
    <module name="org.apache.commons.collections" />
    <module name="org.apache.commons.beanutils" />
    <module name="org.eclipse.jdt" export="true"/>
    <module name="com.lowagie.itext" />
    <module name="org.apache.poi" />
    <module name="org.apache.commons.digester" />
    <module name="org.jfree.chart" />
    <module name="javax.api"/>
    <system export="true">
      <paths>
        <path name="net/sf/jasper/reports"/>
      </paths>
    </system>
  </dependencies>
  <properties>
    <property name="net.sf.jasperreports.compiler.keep.java.file" value="true"/>
    <property name="net.sf.jasperreports.compiler.classpath" value="/usr/share/jboss-as-7-new/modules-agci/net/sf/jasper/reports/main/jasperreports-5.2.0.jar"/>
  </properties>
</module>

这是Jasper Report的module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="net.sf.jasper.reports">
  <resources>
    <resource-root path="jasperreports-5.2.0.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
    <module name="org.apache.commons.logging"/>
    <module name="org.apache.commons.collections"/>
    <module name="org.apache.commons.digester"/>
    <module name="org.apache.commons.beanutils"/>
    <module name="org.eclipse.jdt" export="true"/>
    <module name="net.sf.jasper.reports.fonts" export="true"/>
    <module name="com.lowagie.itext"/>
    <module name="other.fonts.arial"/>
    <module name="other.fonts.times"/>
  </dependencies>
  <properties>
    <property name="net.sf.jasperreports.compiler.keep.java.file" value="true"/>
    <property name="net.sf.jasperreports.compiler.classpath" value="/usr/share/jboss-as-7-new/modules-agci/net/sf/jasper/reports/main/jasperreports-5.2.0.jar"/>
  </properties>
</module>

我总是收到的错误消息是

Errors were encountered when compiling report expressions class file:
/usr/share/jboss-as-7-new/DJR_9154_1554455135225_288300.java:4: error: package net.sf.jasperreports.engine does not exist

当我使用 top 对其进行监视时,我看到javac已执行。

1 个答案:

答案 0 :(得分:0)

最终,我成功找到了答案。 根本原因是jasper-compiler-jdt-5.5.15.jar与模块ecj-3.7.2.jar中的org.jboss.as.web产生了冲突。

解决方案是

  • 我结合了两个JAR,并将其命名为eclipse-combined-jdt-1.0.0.jar
  • 我修订了module.xmlorg.jboss.as.web的{​​{1}}

net.sf.jasper.reports的修订版本是

org.jboss.as.web

<resources> <resource-root path="jboss-as-web-7.2.0.Final.jar" /> <resource-root path="jbossweb-7.2.0.Final.jar" /> <resource-root path="eclipse-combined-jdt-1.0.0.jar" /> </resources> 的修订版本是

net.sf.jasper.reports