在eclipse中我运行以下构建脚本以便能够从.jrxml 获取.jasper文件时出现以下错误:
build.xml:16: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
在build.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>
答案 0 :(得分:0)
这意味着您必须在项目的构建路径中添加apache-commons-logging.jar ...
答案 1 :(得分:0)
我已经将以下jars添加到lib文件夹和类路径中了:commons-flow.jar barbecue-1.5-beta1 barcode4j-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