简体   繁体   English

错误[org.springframework.web.servlet.DispatcherServlet]

[英]ERROR [org.springframework.web.servlet.DispatcherServlet]

My code is built in maven and using jBoss 6 and java 7 我的代码是用maven构建的,使用的是jBoss 6和java 7

The code is working fine on local machine but when i try running war on server i an getting error 代码在本地机器上工作正常但是当我尝试在服务器上运行war时出现错误

ERROR [org.springframework.web.servlet.DispatcherServlet] 错误[org.springframework.web.servlet.DispatcherServlet]

I tried using aop jar but still no success 我尝试使用aop jar但仍然没有成功

Can some one explain me the error and how to solve it 有人可以解释我的错误以及如何解决它

It is failing during the creation of your @Beans . 在创建@Beans期间失败了。 In particular, it is failing because NoClassDefFoundError: org/springframework/core/convert/converter/ConvertingComparator which means it can't find the Class definition for "ConvertingComparator". 特别是它失败了,因为NoClassDefFoundError:org / springframework / core / convert / converter / ConvertingComparator这意味着它无法找到“ConvertingComparator”的类定义。 The earliest documentation I can find on the ConvertingComparator is Spring 3.2.0 . 我在ConvertingComparator上可以找到的最早的文档是Spring 3.2.0 Bear in mind, you are using Spring 3.1.0.RELEASE . 请记住,您使用的是Spring 3.1.0.RELEASE I tried running a basic Spring project using your POM and ran into similar issues using the spring version you provided. 我尝试使用您的POM运行一个基本的Spring项目,并使用您提供的spring版本遇到类似的问题。 I also ran into conflicts with Spring 3.2.0 . 我也遇到了与Spring 3.2.0的冲突。 I recommend using Spring 4.3.5.RELEASE in your POM. 我建议在POM中使用Spring 4.3.5.RELEASE I had no issues running my basic example after setting the properties you have to: 在设置了必须的属性后,我没有遇到运行我的基本示例的问题:

<properties> 
        <org.springframework.version>4.3.5.RELEASE</org.springframework.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

That being said, you may have other issues in your code as well. 话虽如此,您的代码中也可能存在其他问题。 It is difficult to provide a holistic solution without more information. 没有更多信息,很难提供整体解决方案。

EDIT: 编辑:

So here are all your spring dependencies: 所以这里是你所有的春天依赖:

  • spring-beans 弹簧豆
  • spring-web 弹簧网
  • spring-webmvc 弹簧webmvc
  • spring-tx 春天-TX
  • spring-jdbc 弹簧JDBC
  • So first lets talk about redundancy. 首先让我们谈谈冗余。 spring-webmvc actually contains spring-web and spring-beans . spring-webmvc实际上包含spring-webspring-beans You can therefore remove those dependencies from your POM as they are redundant. 因此,您可以从POM中删除这些依赖项,因为它们是冗余的。 spring-jdbc contains spring-tx , rendering that inclusion also redundant. spring-jdbc包含spring-tx ,表示包含也是多余的。 You can remove all of those from your POM right now for clean up. 您可以立即从POM中删除所有这些内容以进行清理。

    In your comment, you mentioned a new error being thrown in regards to package org.springframework.mail not being found. 在您的评论中,您提到了一个关于org.springframework.mail包未找到的新错误。 This package is found in spring-context-support . 此包在spring-context-support中找到 Spring context support is actually found in the spring-webmvc as well as an optional dependency. Spring上下文支持实际上是在spring-webmvc中找到的,也是一个可选的依赖项。 (so you would have to include it manually) (所以你必须手动包括它)

    According to this thread, that package was moved into context-support separately. 根据这个帖子,该包被分别转移到上下文支持中。 My guess is that you are trying to specifically use some of the objects available in the .mail package and because you were not including it, it wasn't being found. 我的猜测是你试图专门使用.mail包中的一些可用对象,因为你没有包含它,所以它没有找到。 With more information as to your project, the more we can dive into why 3.2 did not work and 4.1 does work. 随着有关您的项目的更多信息,我们可以越深入了解为什么3.2不起作用,4.1确实有效。 Specifics aside, what this all means is that the 3.2 dependencies you were calling did not expose the required packages, but the 4.1 dependencies do. 除了细节之外,这一切意味着你所调用的3.2依赖关系没有公开所需的包,但4.1依赖关系会这样做。

    你有没有停止这个过程,我的意思是特定的bean可能正在使用中?

    暂无
    暂无

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

    相关问题 实例化servlet类org.springframework.web.servlet.DispatcherServlet时出错 - Error instantiating servlet class org.springframework.web.servlet.Dispatcherservlet 找不到org.springframework.web.servlet.DispatcherServlet - org.springframework.web.servlet.DispatcherServlet Not Found org.springframework.web.servlet.DispatcherServlet noHandlerFound - org.springframework.web.servlet.DispatcherServlet noHandlerFound org.springframework.web.servlet.DispatcherServlet noHandlerFound 404错误响应 - org.springframework.web.servlet.DispatcherServlet noHandlerFound 404 error response 错误 org.springframework.web.servlet.DispatcherServlet - 上下文初始化失败 - ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed CNF org.springframework.web.servlet.DispatcherServlet - CNF org.springframework.web.servlet.DispatcherServlet HTTP 状态 500 - 实例化 servlet 类 org.springframework.web.servlet.DispatcherServlet 时出错 - HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet org.springframework.web.servlet.DispatcherServlet noHandlerFound:Spring MVC - org.springframework.web.servlet.DispatcherServlet noHandlerFound : Spring MVC java.lang.classnotfoundexception org.springframework.web.servlet.dispatcherservlet - java.lang.classnotfoundexception org.springframework.web.servlet.dispatcherservlet org.springframework.web.servlet.DispatcherServlet class 未找到 - org.springframework.web.servlet.DispatcherServlet class not found
     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM