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.

- 1,313
- 2
- 16
- 31
-
Does it work if you copy/paste the command line and run it in `cmd.exe`? – CrazyCoder Sep 26 '17 at 14:20
-
2This can happen because of an incorrect property/config within your application.properties file. Please relook at the config and correct the mistakes – Thakhani Tharage Nov 23 '19 at 14:56
14 Answers
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();
}
}

- 1,995
- 2
- 14
- 20
-
24That helped me! But I needed to use `Throwable` instead of `Exception` in order to also catch `Error`s. – schrobe Jan 22 '20 at 16:14
-
-
4This should be an accepted answer since it's general. We don't know what the error is and this way is the best one to detect it. Mine was for example illegal syntax at `application.yml` (I missed `}` character in the `logging.pattern.console` configuration). – Nikolas Charalambidis Mar 13 '20 at 11:35
-
I wish I had seen this a day earlier. This would have saved me a lot of time. And using throwable was the way I could find the issue – bcsshdha Jan 27 '21 at 15:41
-
-
-
2Legend! Thanks a lot for this. The logs were being swallowed during start up. – de.la.ru Apr 06 '22 at 14:00
-
-
EDIT: If your code was previously working and you didn't change anything it just stopped working then it might be an IntelliJ issue.
- Delete folder .idea from project folder.
- Delete all .iml from project folder.
Be aware that this will remove the configuration from your workspace.

- 1,313
- 2
- 16
- 31
-
6
-
3CAUTION: this will remove all the configuration of your workspace, you basically need to setup your whole project again – dounyy Feb 10 '22 at 14:38
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,253
- 2
- 33
- 55

- 1,053
- 9
- 26
Maybe not in this case exactly but missing logs could also caused by missing profile configuration in the logback.xml file.

- 1,190
- 12
- 31
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.

- 482
- 2
- 11
- 26
-
1Thanks 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 Pegoraro Apr 30 '18 at 12:49
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

- 173
- 3
- 7
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>

- 136
- 1
- 11
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.

- 3,891
- 1
- 14
- 9
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

- 156
- 1
- 3
For me, after merging feature branch to my local branch, there was a duplicate entry in in my application.yml
file, caused the system not to start with message:
Thanks to @Yasitha Bandara

- 436
- 5
- 17
It's possible you are compiling from the cloud. If so, check if the cloud software is connected to the internet. Or try to sync the cloud software and see it's updated. Then, try to re-compile the work. It should work.
Alternatively, there might be lost link to the source file. E.g., you have moved the file into a new folder and some items didn't follow it to the new location, check this and re-compile.

- 11
- 1
Check you run configuration and run the application with proper profile like local, dev, QA or prod
based on your environment.
I also faced the same problem. I changed the profile and then it started without any issues.
any way just have a try.

- 2,235
- 2
- 23
- 50
for me I added : exclude = DataSourceAutoConfiguration.class
by default spring boot searches for datasource so we need to exclude the same
Example :
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class ProcessorApplication {
public static void main(String[] args) {
try {
SpringApplication.run(ProcessorApplication.class, args);
} catch (Exception e) {
e.printStackTrace();
}
}
now the spring boot will exit normally :

- 941
- 10
- 15