I have created simple spring Boot Application.I have tried so many times but each time it is throwing error:404 Error when I run this on Pivotal tc server.It would be really great if any one can help me this.I have created Controller class with Spring Boot Starter Class.Below the image for the Error I am getting.Pivotal Server is up and running at port 8082 but as soon as I enter /hello to localhost:8082,I am getting Error 404(I have shared image of Pivotal server too in the last).I have almost tried everything that is available on google.I am starter in Spring Boot and would really appreciate if any one can give suggestion to resolve this.I have also shared pom.xml.
404 Error Screenshot-->Error Image.
I am running this on pivotal tc server with url: http://localhost:8082/hello
Link to Pivotal Server url Screenshot--->Pivotal server with controller return url Image Pivotal server is up and running but as soon as I enter http://localhost:8082/hello, I am getting 404 error.Can anyone please help.I have tried everything that I can search for.
Link to Pivotal server up and Running Screenshot-->Pivotal server up and running image
Code for Spring Boot Starter Class:
package io.javabrains.springbootstarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CourseApiApp {
public static void main(String[] args) {
SpringApplication.run(CourseApiApp.class,args);
}
}
Code For controller Class:
package io.javabrains.springbootstarter.hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/hello")
public String sayHi()
{
return("Hello");
}
}
Pom.xml:
<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 http://maven.apache.org/xsd/maven-
4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.javacheck.springbootquickstart</groupId>
<artifactId>course-api-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Java Brains Course Api</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<!-- WEB -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
</project>