BiJ
BiJ

Reputation: 1689

Spring boot 1.5.2 not deploying in Openshift Tomcat 7(JBoss EWS 2.0)

I have a springboot application that I am trying to deploy in Openshift Tomcat 7(JBoss EWS 2.0). Once I restart the server I get below console message

INFO: Deploying web application archive /var/lib/openshift/-----xxxx-----/app-root/runtime/dependencies/jbossews/webapps/api.war
Jun 13, 2017 12:54:41 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/-----xxxx-----/app-root/runtime/dependencies/jbossews/webapps/api.war has finished in 67,610 ms

It says the deployment was successful but I don't get the classic spring logo (shown below) while deployment and all the APIs are giving 404.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.2.RELEASE) I am not getting this in console.

Below are my servlet initializer

public class ServletInitializer extends SpringBootServletInitializer {

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

}

Any reason why this could be happening?

Upvotes: 0

Views: 187

Answers (1)

PRATHAP S
PRATHAP S

Reputation: 775

Try extending SpringBootServletInitializer in your main Spring-Boot Application class as below,

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

@SpringBootApplication
public class DemoApplication extends SpringBootServletInitializer {

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

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}

Upvotes: 1

Related Questions