尝试在这里编译一个Web项目,但我继续获取包不存在几十个类的异常。一切似乎都在类路径中,但它找不到它。有关调试此问题的任何提示吗?
例外:
[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 :(得分:2)
似乎所有东西都在类路径中,却找不到它。
关键词是“似乎”。例外情况告诉你他们不是。
我将创建一个包含所需内容的Ant CLASSPATH,然后重试。
答案 1 :(得分:0)
您的WEB-INF/lib
文件夹中是否有Spring JAR文件?
一切都应该&#34;只是工作&#34;在这种情况下...
是否假设与您的服务器打包在一起?
您可能必须在Eclipse项目/ ANT文件中添加Spring JAR的路径。