How to deploy "war" file built with spring boot to jetty? I am unable to access restful services of my spring boot application when I deploy the war file to jetty.
Steps I followed:
- Referring to Spring boot war documentation I created a war file. I could see the files are available in the war file.
- Copied the war to
${jetty home}/webapps. (/usr/share/jetty/webapps) - Added a contexts.xml file with my war name (excluding .war suffix)
- Restarted Jetty service
- Copied the war to
When I browse localhost:8080 I see folder structure of my web app. (i.e WEB-INF resources)
None of spring resource paths are available from localhost. My spring application has JAX-RS resource. Below is my ApplicationInitializer class (Groovy).
class ApplicationInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
Properties props = getPropertiesFromArgs()
return new SpringApplicationBuilder([Application, "classpath:/META-INF/com/foo/testapp/bootstrap.xml"] as Object[])
.properties(props)
}
Its as-if jetty start did not start spring context. What am I missing? Application works fine if I run the spring boot built uber jar. I can access all restful resources of the app.