启动tomcat时出现Maven Spring(4.1.1版)问题

时间:2018-07-27 14:24:53

标签: spring maven

我正在使用Java 8,spring 4.x和Maven 4构建项目。

我使用以下命令来构建和运行项目:

 var box = document.querySelector('.carouselbox');
 var next = box.querySelector('.next');
 var prev = box.querySelector('.prev');

    function carousel() {

       var items = box.querySelectorAll('.content li');
       var counter = 0;
       var amount = items.length;
       var current = items[0];

       box.classList.add('active');

       function navigate(direction) {

           current.classList.remove('current');
           counter = counter + direction;

           if (direction == -1 && counter < 0) {

               counter = amount - 1; 
           }

           if (direction == 1 && !items[counter]) {

               counter = 0;
           }

           current = items[counter];
           current.classList.add('current');
       }

       next.addEventListener('click', function(ev) {

            navigate(1);
       });

       prev.addEventListener('click', function(ev) {

            navigate(-1);
       });

       navigate(0);
  }

我正在尝试在Windows 8平台上运行该项目。     使用Maven 4构建项目后,尝试启动tomcat时出现错误消息:

mvn clean install
mvn tomcat:run

我的pom.xml

Jul 27, 2018 3:07:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2018-07-27 15:07:40 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/ResolvableTypeProvider

Jul 27, 2018 3:07:40 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jul 27, 2018 3:07:40 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/CounterWebApp] startup failed due to previous errors
Jul 27, 2018 3:07:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext

我进行了一些调查,我认为Spring版本可能存在问题,但是我已经检查过Maven,并且它仅具有Spring 4.1.1依赖项。

1 个答案:

答案 0 :(得分:0)

您在Spring版本中遇到的问题。使用Spring 3.2.0