0

在 Eclipse 中,当我在构建脚本下运行以能够从 .jrxml获取 .jasper 文件时,我收到以下错误:

build.xml:16: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

构建.xml:

<?xml version="1.0" encoding="UTF-8"?>
  <project name="jasperreports" default="compile" basedir=".">
  <path id="classpath">
        <pathelement location="."/>
        <fileset dir="lib" erroronmissingdir="false">
            <include name="**/*.jar"/>
        </fileset>
  </path>
  <target name="compile">
            <taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask"> 
                <classpath refid="classpath"/>
            </taskdef>
            <jrc 
                destdir="reports"
                tempdir="reports"
                keepjava="false">
                <src>
                    <fileset dir="reports">
                        <include name="**/*.jrxml"/>
                    </fileset>
                </src>
                <classpath refid="classpath"/>
            </jrc>
    </target>
</project>
4

2 回答 2

0

这意味着您必须在项目的构建路径中添加apache-commons-logging.jar ...

于 2013-05-09T07:00:19.067 回答
0

我已将以下 jar 添加到 lib 文件夹和类路径中:commons-flow.jar BBQ-1.5-beta1barcode4j-2.0 commons-beanutils-1.8.0 commons-collections-2.1 commons-javaflow.jar commons-javaflow-20060411 jline -0.9.94 js-1.7R1 junit-3.8.2 persistence-api-1.0 saaj-api-1.3 spring-beans-2.5 spring-core-2.5 xml-apis-1.3.04

于 2013-05-09T08:10:12.217 回答