spring boot 使用 jersey-starter时打包成jar包无法启动,堆栈提示缺少文件

错误提示Tomcat起不来,然后是jersey自动配置类注册失败,
最终堆栈提示找不到文件,实际解压jar包查看文件时存在的

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
...
java.io.FileNotFoundException: D:\Projects\pms\target\pms.jar!\BOOT-INF\classes (系统找不到指定的路径。)

jersey配置类,使用的包扫描
在这里插入图片描述
查阅spring boot 文档发现,Jersey对可执行的压缩包扫描相当有限,推荐使用register()方法注册所有端点,然后确实是这个问题,动起手来挨个注册吧!
在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐