配置org.springframework.web.context.ContextLoaderListener类的应用程序侦听器时出错

问题描述 投票:5回答:2

我正在尝试通过IntelliJ IDEA 11.0部署我的应用程序,它给了我以下错误:

09:35:52,997 WARN  [JAXWSDeployerHookPreJSE] Cannot load servlet class: org.springframework.web.servlet.ViewRendererServlet
09:35:52,999 INFO  [TomcatDeployer] deploy, ctxPath=/my-portlet-1.0, warUrl=.../tmp/deploy/tmp555932443707493677my-portlet-1.0-exp.war/
09:35:53,386 ERROR [0]] 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:1358)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    ...
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
09:35:53,391 ERROR [0]] Skipped installing application listeners due to previous error(s)
09:35:53,391 ERROR [StandardContext] Error listenerStart
09:35:53,391 ERROR [StandardContext] Context [/my-portlet-1.0] startup failed due to previous errors
09:35:53,402 WARN  [ServiceController] Problem starting service jboss.web.deployment:war=my-portlet-1.0.war,id=-135869088
org.jboss.deployment.DeploymentException: URL file:/C:/JBOSS/jboss-portal-2.7.2/server/default/tmp/deploy/tmp555932443707493677my-portlet-1.0-exp.war/ deployment failed
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:386)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
    ...
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
09:35:53,407 ERROR [MainDeployer] Could not start deployment: file:C:/Users/Abbas/Projects/my-app/my-portlet/target/my-portlet-1.0.war
org.jboss.deployment.DeploymentException: URL file:/C:/JBOSS/jboss-portal-2.7.2/server/default/tmp/deploy/tmp555932443707493677my-portlet-1.0-exp.war/ deployment failed
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:386)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
    ...
    at java.lang.Thread.run(Thread.java:662)
[2012-07-25 09:35:53,431] Artifact my-portlet:war: Error during artifact deployment. See server log for details.

有谁知道如何解决这一问题?

spring spring-mvc jboss
2个回答
0
投票

ContextLoaderListener位于org.springframework.web-3.0.4.RELEASE.jar中

你提到了一个名为org.springframework-3.0.4.RELEASE.jar的文件,它是不同的。

也许你的依赖文件中有拼写错误?


0
投票

实际上,我也面临同样的问题,浪费了很多时间。我意识到实际上这是一个非常愚蠢的错误。您必须更改了pom文件并更新了依赖项。但是一旦我们这样做,maven依赖项的jar文件就会从部署程序集中删除。

你需要做的就是:

  • 右键单击项目文件夹。
  • 点击属性。
  • 单击Web部署程序集。
  • 检查是否列出了maven依赖项。
  • 如果没有,请单击添加按钮
  • 从列表中选择maven依赖项并完成,应用并确定!

希望这能解决你的问题。如果你还有它!

© www.soinside.com 2019 - 2024. All rights reserved.