2012-03-07 80 views
0

试图在这里编译一个Web项目,但我一直在获取软件包不存在几十个例外。一切似乎都在classpath中,但它找不到它。有关调试此问题的任何提示?

例外:
Ant javac:软件包不存在

[javac] Compiling 73 source files to C:\workspace\SalesWeb\WebContent\WEB-INF\classes 
[javac] C:\workspace\SalesWeb\src\java\com\abc\xyz\supplier\interceptor\InfoInterceptor.java:8: package org.springframework.web.servlet does not exist 
[javac] import org.springframework.web.servlet.HandlerInterceptor; 

在build.xml:

<?xml version="1.0" encoding="UTF-8"?> 

<project basedir="." default="build" name="SalesWeb"> 
<property environment="env"/> 
<property name="SalesWebTest.location" value="../SalesWebTest"/> 
<property name="debuglevel" value="source,lines,vars"/> 
<property name="target" value="1.6"/> 
<property name="source" value="1.6"/> 
<path id="Web App Libraries.libraryclasspath"> 
    <pathelement location="WebContent/WEB-INF/lib/backport-util-concurrent-2.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/cxf-2.2.5.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/displaytag-1.1.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/dwr.3.rc1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/abc-frameworkx-web.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/abc-svc-framework-web-2008.1.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/ehcache-1.4.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/ezmorph-1.0.6.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/fdsapi-1.1.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/freemarker-2.3.8.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/jakarta-oro.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/jaxb-impl-2.1.13.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/joda-time-1.6.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/json-lib-2.4-jdk15.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/org.springframework.config.java-1.0.0.M4.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/org.springframework.js-2.0.6.RELEASE.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/org.springframework.webflow-2.0.6.RELEASE.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/oscache-2.3.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/poi-3.5-FINAL-20090928.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/sitemesh-2.4.2.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/spring-security-taglibs-2.0.4.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/spring-web.2.5.6.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/spring-webmvc.2.5.6.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/standard-1.1.2.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/urlrewritefilter-3.0.4.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/velocity-1.4.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/velocity-tools-view-1.0.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/wsdl4j-1.6.2.jar"/> 
    <pathelement location="WebContent/WEB-INF/lib/xwork-2.0.4.jar"/> 
</path> 
<path id="EAR Libraries.libraryclasspath"> 
    <pathelement location="../../../SalesWeb_C"/> 
    <pathelement location="../../../SalesWeb_D"/> 
    <pathelement location="../../../SalesWeb_J"/> 
    <pathelement location="../../../SalesWeb_S"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-beanutils-1.8.0.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-collections-3.2.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-dbcp-1.2.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-digester-1.7.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-lang-2.5.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-logging-1.1.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-pool-1.3.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/aspectj/cglib-nodep-2.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/db/db2jcc.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/db/db2jcc_license_cisuz.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/JAMon.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/cryptix32.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/dsclass.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/eas-svc-framework-2008.1.3.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/eas-svc-mid-2008.1.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/eas-svc-security-impl-2008.1.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/eas-svc-security-impl-multitree-2008.1.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/fdsapi-1.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/jce1_2-do.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/jcert.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/jnet.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/jsse.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/providerutil.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/signon.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/hcsc/xsdbeans-5.0.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/ldap40.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/logging/log4j-1.2.15.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/neethi-2.0.4.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/saaj-api-1.3.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/saaj-impl-1.3.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/spring/spring.2.5.6.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/stax-utils-20060502.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/webservice/jaxws-api.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/webservice/wsdl4j-1.6.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/wstx-asl-3.2.4.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xml/XmlSchema-1.4.5.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xml/dom4j-1.6.1.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xml/xml-resolver-1.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/spring/spring-security-core-2.0.4.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/spring/spring-security-core-tiger-2.0.4.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/spring/spring-security-taglibs-2.0.4.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/apache/commons-io-1.2.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/javassist-3.9.0.GA.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/jsr173_1.0_api.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/resolver.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/xbean.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/xbean_xpath.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/xmlbeans-qname.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/xmlbeans/xmlpublic.jar"/> 
    <pathelement location="../SalesWeb_ear/lib/commons-net-2.0.jar"/> 
    <pathelement location="../../../SalesWeb_I"/> 
    <pathelement location="../../../SalesWeb_RC"/> 
    <pathelement location="../../../SalesWeb_R"/> 
</path> 

<path id="SalesWeb.classpath"> 
    <pathelement location="WebContent/WEB-INF/classes"/> 
    <path refid="Web App Libraries.libraryclasspath"/> 
    <path refid="EAR Libraries.libraryclasspath"/> 

</path> 


<target name="init"> 
    <mkdir dir="WebContent/WEB-INF/classes"/> 
    <copy includeemptydirs="false" todir="WebContent/WEB-INF/classes"> 
     <fileset dir="src/java" excludes="**/*.launch, **/*.java"/> 
    </copy> 
    <copy includeemptydirs="false" todir="WebContent/WEB-INF/classes"> 
     <fileset dir="src/config" excludes="**/*.launch, **/*.java"/> 
    </copy> 
    <copy includeemptydirs="false" todir="WebContent/WEB-INF/classes"> 
     <fileset dir="src/resources" excludes="**/*.launch, **/*.java"/> 
    </copy> 
    <copy includeemptydirs="false" todir="WebContent/WEB-INF/classes"> 
     <fileset dir=".apt_generated" excludes="**/*.launch, **/*.java"/> 
    </copy> 
</target> 
<target name="clean"> 
    <delete dir="WebContent/WEB-INF/classes"/> 
</target> 
<target depends="clean" name="cleanall"/> 
<target depends="build-subprojects,build-project" name="build"/> 
<target name="build-subprojects"/> 
<target depends="init" name="build-project"> 
    <echo message="${ant.project.name}: ${ant.file}"/> 
     <javac debug="true" debuglevel="${debuglevel}" destdir="WebContent/WEB-INF/classes" source="${source}" target="${target}" includeantruntime="false"> 
     <src path="src/java"/> 
     <classpath refid="SalesWeb.classpath"/> 
    </javac> 
    <javac debug="true" debuglevel="${debuglevel}" destdir="WebContent/WEB-INF/classes" source="${source}" target="${target}" includeantruntime="false"> 
     <src path="src/config"/> 
     <classpath refid="SalesWeb.classpath"/> 
    </javac> 
    <javac debug="true" debuglevel="${debuglevel}" destdir="WebContent/WEB-INF/classes" source="${source}" target="${target}" includeantruntime="false"> 
     <src path="src/resources"/> 
     <classpath refid="SalesWeb.classpath"/> 
    </javac> 
    <javac debug="true" debuglevel="${debuglevel}" destdir="WebContent/WEB-INF/classes" source="${source}" target="${target}" includeantruntime="false"> 
     <src path=".apt_generated"/> 
     <classpath refid="SalesWeb.classpath"/> 
    </javac> 
</target> 

+0

@Marvin,构建文件附加 – user1195192 2012-03-07 19:22:20

回答

2

一切都似乎是在classpath中,但它无法找到它。

关键词有“似乎”。异常告诉你他们不是。

我会创建一个Ant CLASSPATH,其中包含您需要的内容并再次尝试。

http://ant.apache.org/manual/develop.html

+0

嗨duffy,我附加了构建文件。 – user1195192 2012-03-07 19:22:33

+0

我会使用内置的“WebContent/WEB-INF/lib/*。jar”表示法并将其清理干净。它有用吗? – duffymo 2012-03-07 20:42:13

0

是你WEB-INF/lib文件夹中的春天JAR文件?

一切都应该在这种情况下,“只是工作” ...

是否认为你的服务器被打包?

您可能需要在Eclipse项目/ ANT文件中添加Spring JAR的路径。

+0

嗨Nate,Spring jars在lib文件夹中。 – user1195192 2012-03-07 19:29:58