我解決的辦法是把.m2倉庫所有文件刪除,重新maven project就可以了。
但是在做這一步之前,報錯如下:
①org.springframework.beans.factory.UnsatisfiedDependencyException
②ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test]]
③Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException:
④org.apache.catalina.LifecycleException
⑤Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'userMapper'
⑥java.lang.IllegalStateException: Failed to load ApplicationContext
⑦Caused by: java.lang.ClassNotFoundException: Cannot find class: com.github.pagehelper.PageInterceptor
大概報了這七個錯誤,特別惡心。原因可能是我導入其他項目時,maven project污染了.m2倉庫中的文件。
