Today when I use Spring Boot to restart my application then the console prompted that
Execution failed for task ':Application.main()'.
> Process 'command 'C:/Java/jdk8/bin/java.exe'' finished with non-zero exit value 1
I don't know how to resolve this issue
This is my application.java
and application.yaml
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
server:
port: 80
and the version of Spring Boot and Gradle is 2.3.7.RELEASE and 6.1.1
Any ideas?
Okay,I have resloved the issue and I will share you.
In the gradle cache file, I found some logs like below
***************************
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).
FAILURE: Build failed with an exception.
this issue is I dont have some database config for SpringBoot start. so when I added database config in the resource folder and created an application.yaml file,then start successful.
That's all,Maybe next time we can add the config file first or we can config log for ourself.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.