简体   繁体   English

与Maven在eclipse的春天网项目

[英]Spring web project with Maven at eclipse

I have recently practice on spring with maven. 我最近在与maven的春天练习。 But face flowing problem. 但面对流动的问题。 After updating project at maven-> update project it shown cross sign at java Resources. 在maven-> update项目更新项目后,它在java Resources上显示了交叉标志。 and when i run this project it shown flowing error: 当我运行这个项目时,它显示了流动错误:

Feb 27, 2015 5:32:00 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4638)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Feb 27, 2015 5:32:00 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s) 

please assist me if anyone knows the exact solution. 如果有人知道确切的解决方案,请帮助我。 在此输入图像描述

 <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

Add this to your web.xml 将其添加到您的web.xml

It looks like you are missing the spring-web dependency. 看起来你错过了spring-web依赖。 This is where the class org.springframework.web.context.ContextLoaderListener is declared. 这是声明org.springframework.web.context.ContextLoaderListener类的地方。

Add this dependency to your pom.xml : 将此依赖项添加到您的pom.xml

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>4.1.5.RELEASE</version> <!-- replace with your Spring version -->
</dependency>

If everything is fine related to configuration and still you are getting ClassNotFoundException then check your maven deployment configuration at least once. 如果一切都与配置完全相关,但仍然会收到ClassNotFoundException那么至少检查一次maven部署配置。

Right click on project-->>Select deployment Assembly >> then press on add button and then >> select java build path entries (Maven libraries should be there if everything is fine) add then >> Apply and done.:) 右键单击项目 - >>选择部署程序集>>然后按下添加按钮然后>>选择java构建路径条目(如果一切正常,Maven库应该在那里)添加然后>>应用并完成。:)

在此输入图像描述

I have just find out this problem solution. 我刚刚找到了这个问题的解决方案。 After change tomcat server 7 to 6 and add runt it's given write output. 在更改tomcat服务器7到6之后添加runt它给出了写输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM