1

Windows 7、Java jdk1.6.0_32、Ant 1.9

用户和系统变量:

JAVA_HOME :C:\Program Files\Java\jdk1.6.0_32

路径:C:\Program Files\Java\jdk1.6.0_32;c:\ant\bin;

ANT_HOME:c:\ANT

Run command prompt as administrator
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

H:\>c:

C:\>w:

W:\>cd webadvisor

W:\WebAdvisor>cd wasql*

W:\WebAdvisor\WASQLTEST3>c:\ant\bin\ant
Buildfile: W:\WebAdvisor\WASQLTEST3\build.xml

init:

prepare:
 [echo] Preparing Update...
 [copy] Copying 208 files to W:\WebAdvisor\WASQLTEST3\temp
 [copy] Copying 129 files to W:\WebAdvisor\WASQLTEST3\temp
 [copy] Copying 49 files to W:\WebAdvisor\WASQLTEST3\temp

splitdocs:

merge-cleanup:
[delete] Deleting: W:\WebAdvisor\WASQLTEST3\custom\WEB-INF\web.xml

findwebxml:

merge:

datatelxmloverride:

mergeDefault:

BUILD FAILED
W:\WebAdvisor\WASQLTEST3\build.xml:112: The following error occurred while executing this line:
W:\WebAdvisor\WASQLTEST3\build.xml:165: The following error occurred while executing this line:
W:\WebAdvisor\WASQLTEST3\build.xml:173: java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat
        at org.codehaus.cargo.module.webapp.WebXmlIo.writeWebXml(WebXmlIo.java:256)
        at org.codehaus.cargo.module.webapp.WebXmlIo.writeWebXml(WebXmlIo.java:225)
        at org.apache.cactus.integration.ant.WebXmlMergeTask.execute(WebXmlMergeTask.java:120)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at 
4

2 回答 2

1

org/apache/xml/serialize/OutputFormat 是一个 Xerces 类...在您的系统中搜索 xerces*.jar。这个文件存在吗?它在你的类路径中吗?

于 2013-05-01T21:26:06.333 回答
0

您的类路径缺少所需的 jar

org/apache/xml/serialize/OutputFormat

检查你xercesImpl.jar的类路径中是否有

编辑

您可以通过在 ant 编译目标中包含所需的 jar 并将所有所需的 jar 放在 lib 文件夹中来设置。

<target name="compile" depends=""   description="compile the java source files">  
 <javac srcdir="." destdir="${build}">  
    <classpath>  
        <fileset dir="${lib}">  
            <include name="**/*.jar" />  
        </fileset>  
    </classpath>  
</javac>  
于 2013-05-01T21:20:08.213 回答