我不确定为什么会出现这个错误。这里有很多类似的问题,但到目前为止都没有为我解决。
我的ivy文件是
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info
organisation=""
module="knoxWeb"
status="integration">
</info>
<dependencies>
<dependency org="org.springframework" name="spring-core" rev="4.0.3.RELEASE"/>
<dependency org="org.springframework" name="spring-context" rev="4.0.3.RELEASE"/>
<dependency org="org.springframework" name="spring-web" rev="4.0.3.RELEASE"/>
<dependency org="org.springframework" name="spring-webmvc" rev="4.0.3.RELEASE"/>
<dependency org="org.springframework" name="spring-beans" rev="4.0.3.RELEASE"/>
</dependencies>
</ivy-module>
我的web.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Knox Web Interface</display-name>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
我已经解决了ivy,但是还是出现错误。我可以在我的eclipse中看到这个类。
我真的很困扰。任何帮助或建议都会受到赞赏。
PS:我也尝试添加
<dependency org="org.springframework" name="spring" rev="2.5.6"/>
,但是ivy无法解析。我得到以下错误:Some projects fail to be resolved
Impossible to resolve dependencies of #TestWebProject;working@BLT430LT3201C
download failed: com.oracle.toplink#toplink;10.1.3!toplink.jar
unresolved dependency: com.oracle#oc4j;1.0: not found
unresolved dependency: com.oracle#toplink-essentials;2.41: not found
unresolved dependency: javax.ejb#ejb;3.0: not found
download failed: com.bea.wlplatform#commonj-twm;1.1!commonj-twm.jar
unresolved dependency: jexcelapi#jxl;2.6.6: not found
download failed: javax.jms#jms;1.1!jms.jar
download failed: javax.faces#jsf-api;1.1!jsf-api.jar
download failed: javax.resource#connector;1.0!connector.jar
我不确定这是否与上述问题有关。我在搜索http://mvnrepository.com/artifact/org.springframework以获取所有依赖信息。
我的项目结构如下:
来源:http://opensourceforgeeks.blogspot.in/2014/05/javalangclassnotfoundexception.html