0
votes

I have a Spring-boot gradle application which is not having any web pages.This application is having REST api's which are successfully getting called when i am running it as a Spring boot application.

Now after generation war from gradle, when i am trying to deploy it in apache-tomcat-8.0.35, it's getting deployed and directory structure is as follows:-

Directory Structure

but now i am not able to access my REST api with tomcat port 8080. I have already checked tomcat is up at http://localhost:8080. On calling the REST Api I am getting the below error:

HTTP Status 403

Can anybody please help me with this.

Thanks

1
This seems to be access forbidden error. Please check your tomcat configuration if it has any filters installed or other configurations which is preventing the access.kk.
Enabled Security ?PRATHAP S
@PRATHAPS I have just downloaded a fresh copy of tomcat and deployed my application in it.Manish

1 Answers

0
votes

Add dependencies in build.gradle:

providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'

And add a class:

public class ServletInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}