简体   繁体   中英

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

My code is built in maven and using jBoss 6 and java 7

The code is working fine on local machine but when i try running war on server i an getting error

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

I tried using aop jar but still no success

Can some one explain me the error and how to solve it

It is failing during the creation of your @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". The earliest documentation I can find on the ConvertingComparator is Spring 3.2.0 . Bear in mind, you are using 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. I also ran into conflicts with Spring 3.2.0 . I recommend using Spring 4.3.5.RELEASE in your POM. 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
  • spring-tx
  • spring-jdbc
  • So first lets talk about redundancy. spring-webmvc actually contains spring-web and spring-beans . You can therefore remove those dependencies from your POM as they are redundant. spring-jdbc contains spring-tx , rendering that inclusion also redundant. You can remove all of those from your POM right now for clean up.

    In your comment, you mentioned a new error being thrown in regards to package org.springframework.mail not being found. This package is found in spring-context-support . Spring context support is actually found in the spring-webmvc as well as an optional dependency. (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. With more information as to your project, the more we can dive into why 3.2 did not work and 4.1 does work. 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.

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

    The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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