当前位置:编程学习 > JAVA >>

eclipse maven工程报spring ContextLoaderListener异常

症状:

maven web工程,启动server,报ContextLoaderListener异常,部署位置的lib目录里没有工程相关的jar

 

解决:

方法1
打开eclipse工程目录,在.classpath中添加或修改如下

01
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
02
    <attributes>
03
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
04
    </attributes>
05
</classpathentry>
06
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
07
    <attributes>
08
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
09
    </attributes>
10
</classpathentry>
方法2

右键工程,属性

选择 Deployment Assembly点击add选中Maven Dependencies,最后finish。如下图

 image
作者:藏言

补充:软件开发 , Java ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,