- 运行jar时报错:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-06 13:59:03.887 ERROR 25750 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
- 分析重点:
o.s.b.d.LoggingFailureAnalysisReporter
-
原因:logger方面出的问题,检查自己的logger在properties中配置的路径为/home/xxx/。由于在mac目录中没有/home/目录,虽然打包成功了,但是运行时会出错,并且在centos中即使有/home/目录也无法运行。
解决办法:修改mac中logger配置的目录为/opt/xxx (centos中也有opt目录),再给mac中的/opt/xxx目录赋予读写权限:sudo chmod +x 777 /opt/xxx
-
最后:报错
To display the conditions report re-run your application with 'debug' enabled.
的原因有多种,具体要看其后面一行去找错误的具体原因。
网友评论