通过maven方式,war部署springboot项目遇到的bug总结

打包过程参考:http://how2j.cn/k/springboot/springboot-war/1655.html#nowhere

bug总结如下:

1.使用命令mvn clean package 报错:java.lang.NoClassDefFoundError:org/springframework/boot/context/properties/source/ConfigurationPropertySource

解决方法:mvn clean package -Dmaven.test.skip=true 打包时忽略测试代码即可解决

2.报错java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]

报错原因:spring-webmvc的版本与spring-test的版本不一致

解决方法:使spring-webmvc的版本与spring-test的版本一致

3.将打包的ROOT.war部署到Tomcat/webapps 下,

报错:org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Standard

解决方法:删去webapp下的ROOT文件夹

猜你喜欢

转载自blog.csdn.net/Cary_1029/article/details/83420270
今日推荐