springboot 项目部署 linux 报错 illegalargumentexception: name
问题描述:
在 intellij idea 环境中正常运行的 springboot 项目,部署到 linux 系统后无法启动,抛出 illegalargumentexception: name 异常。
排查过程:
解决方法:
经过排查,发现问题出在打包阶段。查看 manifest.mf 文件,发现缺少 start-class 属性,导致 springboot 无法找到应用程序入口。
解决方案:
在构建配置中指定 springbootapplication 类的全限定名作为 main-class。
org.springframework.boot spring-boot-maven-plugin
com.example.demo.Application
解决此问题耗时较长,由于 jdk 1.8 对该异常提示的的信息不足,导致排查方向出现偏差。