Process finished with exit code 1 Spring Boot Intellij

后端 未结 8 1650
我在风中等你
我在风中等你 2021-02-12 23:04

I\'ve received the message "Process finished with exit code 1" when I run my project. I have tried several solutions but no topic is the same error as mine. My project

相关标签:
8条回答
  • 2021-02-12 23:43

    You must set logging.level.root to DEBUG and read related logging to find problem. if your app uses application.yml file, add (or edit) this at beginning or end:

    logging:
      level:
        root: DEBUG
    

    if your app uses application.properties, add (or edit) below line:

    logging.level.root: DEBUG
    

    for example, my app uses an undefined property and does not show the problem in common logs, after enabling debug level logging, I got below line in logs:

    Could not find key 'app.services.account.service' in any property source
    
    0 讨论(0)
  • 2021-02-12 23:43

    Maybe not in this case exactly but missing logs could also caused by missing profile configuration in the logback.xml file.

    0 讨论(0)
  • 2021-02-12 23:45
    1. Delete folder .idea from project folder.
    2. Delete all .iml from project folder.
    0 讨论(0)
  • 2021-02-12 23:48

    Had the same problem.
    Fixed by specifying parent Spring Boot Starter project.

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath />
    </parent>
    
    0 讨论(0)
  • 2021-02-12 23:55

    I encounter the same problem. Springboot exits with code 1 without error. But that was when I created a project without using Spring Initializer.

    I suggest you backup your code and recreate the project with Spring Initializer (service URL: https://start.spring.io), that should work. and you will be able to compare the setup difference.

    0 讨论(0)
  • 2021-02-12 23:57

    Try to get stack trace by putting "try-catch" block, arround "run" method calling, in your main method, and print stack trace within "catch" as follows.

       public static void main(String[] args) {
        try {
            SpringApplication.run(MyApplication.class, args);
        } catch (Exception e) {
            e.printStackTrace(); 
        }
    }
    
    0 讨论(0)
提交回复
热议问题