java打包exe主启动类未找到_Spring Boot 工程,打包成Fat jar方式启动,在特定环境下找不到主类?...

最近碰到了一个棘手的问题,

一个 spring boot 工程,打包成可执行的 fat jar。jar包没有问题,在各个环境都运行正常。但是唯独在其中一个服务器上启动会报错,而且,更诡异的是,当前目录在 /shell 目录,jar包正常启动,切换到其他目录才会报错。

下面是启动报错的情况下输出的日志,加了 -Dloader.debug=true ,可以看到加载的一些细节。

Trying classpath: /BOOT-INF/classes/application.properties

Not found: classpath:BOOT-INF/classes/application.properties

Property 'loader.path' from environment: /data/application/xxx/xxx-batch-new/conf

Nested archive paths: [/data/application/xxx/xxx-batch-new/conf/]

Property 'Loader-Args' from home directory manifest: null

Adding classpath entries from /data/application/xxx/xxx-batch-new/conf

Property 'Loader-ClassLoader' from home directory manifest: null

Property 'Start-Class' from home directory manifest: null

Exception in thread "main" java.lang.IllegalStateException: No 'loader.main' or 'Start-Class' specified

at org.springframework.boot.loader.PropertiesLauncher.getMainClass(PropertiesLauncher.java:317)

at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)

at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)

这里是正常启动的时候输出的日志,虽然有明显的差别,但是,毕竟是个运维,翻了半天 spring boot的源码,仍然没找到真正的原因。还希望大家多指点指点。

Trying classpath: /BOOT-INF/classes/application.properties

Not found: classpath:BOOT-INF/classes/application.properties

Property 'loader.path' from environment: /data/application/xxx/xxx-batch-new/conf

Nested archive paths: [/data/application/xxx/xxx-batch-new/conf/]

Property 'Start-Class' from archive manifest: com.xxx.xxx.BatchApplication

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值