30

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 doesn't execute any line of code, just abort the process.enter image description here

Roberto
  • 1,190
  • 2
  • 14
  • 29

10 Answers10

96

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(); 
    }
}
Yasitha Bandara
  • 1,635
  • 1
  • 12
  • 19
7
  1. Delete folder .idea from project folder.
  2. Delete all .iml from project folder.
Roberto
  • 1,190
  • 2
  • 14
  • 29
5

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
3

This command did the job for me:

mvn idea:idea
Abdennacer Lachiheb
  • 2,110
  • 5
  • 24
  • 52
2

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

kpater87
  • 1,110
  • 12
  • 31
1

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.

ChrisZ
  • 470
  • 2
  • 10
  • 23
  • 1
    Thanks for your response. My project was created as you suggested and it always worked. My problem is that it stopped working without any source modification. – Roberto Apr 30 '18 at 12:49
0

Its very complicated because mostly it might happen due to missing of properties. In my case the below property not defined in application.properties which cause this issue and its clue less. Hope this will help you

Due to missing properties like server port or any other placeholder which is defined in any Bean or Component can cause this issue. verify all the properties and placeholders.

  @Value(value = "${resource.path.accountNumbers}")
            private Resource accountNumbers;
    application.properties--verify all properties/placeholders
    resource.path.accountNumbers=classpath:accountNumbers.properties
Kanthishere
  • 160
  • 3
  • 7
0

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>
havryliuk
  • 54
  • 8
0

For springboot projects, the most common reason is org.springframework.beans.factory.BeanCreationException. Search BeanCreationException, debug at each construct function, and debug the projects. Then you will find out the 'beanName' with problem, then you can focus on the bean.

for example: enter image description here

hatanooh
  • 3,293
  • 1
  • 13
  • 8
0

My problem was as simple as some bad VM options because of copy/pasting from a strange application that omitted all the equal signs

I had

-Dconfig.file/somepathtothefile/resources/application.conf

instead of

-Dconfig.file=/somepathtothefile/resources/application.conf
dustEffect
  • 156
  • 1
  • 3