nanda kumar
nanda kumar

Reputation: 33

Process finished with exit code 0 Spring Boot Application

i am creating the simple spring boot project while i running the project IntelliJ Process finished.Process finished with exit code 0 i don't know what will be the reason.what tried so far i attached below

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>Crudnew</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Crudnew</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.27</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

TestController

@RestController
@CrossOrigin
@RequestMapping("api/v1/test")
public class TestController {

    @PostMapping
    public void getMyApp()
    {
        String myApp = "This my First Application";
        System.out.println(myApp);
    }

}

While Running the Project i got this line then exit

2022-11-15 16:46:22.330  INFO 29988 --- [           main] com.example.Crudnew.CrudnewApplication   : Starting CrudnewApplication using Java 1.8.0_202 on LAPTOP-RGN0DEFS with PID 29988 (F:\Crudnew\Crudnew\target\classes started by HP in F:\Crudnew\Crudnew)
2022-11-15 16:46:22.333  INFO 29988 --- [           main] com.example.Crudnew.CrudnewApplication   : No active profile set, falling back to 1 default profile: "default"
2022-11-15 16:46:22.721  INFO 29988 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-15 16:46:22.728  INFO 29988 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 0 JPA repository interfaces.
2022-11-15 16:46:22.997  INFO 29988 --- [           main] com.example.Crudnew.CrudnewApplication   : Started CrudnewApplication in 1.063 seconds (JVM running for 1.874)

Process finished with exit code 0

Upvotes: 1

Views: 2781

Answers (1)

kenneth
kenneth

Reputation: 728

Can you put the starter-web dependency above the data-jpa one and try again?

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

Upvotes: 1

Related Questions