How to deploy SpringBoot and Keycloak war on tomcat 9 - spring-boot

I want to use SpringBoot 2.1.4.RELEASE, Keycloak 6.0.1, java 8 and deploy the war in an external tomcat 9 that also has other applications.
Keycloak documentation mentions -
https://github.com/keycloak/keycloak-documentation/blob/master/securing_apps/topics/oidc/java/spring-boot-adapter.adoc
'If you plan to deploy your Spring Application as a WAR then you should not use the Spring Boot Adapter and use the dedicated adapter for the application server or servlet container you are using. Your Spring Boot should also contain a web.xml file.'
Keycloak does not have tomcat 9 adapter.
is there any way to deploy the war on tomcat 9 ?
in my app, I don't have web.xml. Should I create an empty web.xml ?

Related

How to deploy Spring Cloud Gateway 2.1 on Jboss or Tomcat?

I want to a deploy Spring Cloud Gateway but it is built on Spring Framework 5, Project Reactor.
Can I create a WAR file and deploy it on a traditional application server such as Jboss or Tomcat.
The Spring documentation in this page says it is possible.
Spring WebFlux is supported on Tomcat, Jetty, Servlet 3.1+ containers
Note:
this is Spring Cloud Gateway project link
https://spring.io/projects/spring-cloud-gateway
I don't think this is possible, as Spring Cloud Gateway is itself a Spring Boot WebFlux application and this use case is only supported with embedded servers, as mentioned in the Spring Boot reference documentation.

Tomcat 7 deployment issue for Spring boot application

I have created an application on spring boot using JPA and JDK 7 but I am unable to deploy this to Tomcat 7. Does tomcat 7 support Spring boot 2.0.5.RELEASE version and the associated jar for JPA/Hibernate.
Spring Boot 2.0, requires a Servlet 3.1 container. Tomcat 7 is a Servlet 3.0 container.
So it wont work.

Spring boot 2 with webflux and Router functions war does not work with standalone tomcat server

The application runs fine on spring boot embedded tomcat 8.5.28 (gradle bootRun) but when I create the war and put the same in stand alone tomcat server (8.5.28) the application always throws 404 for any of the routes configured.
The application runs fine on spring boot embedded tomcat 8.5.28 (gradle bootRun) but when I create the war and put the same in stand alone tomcat server (8.5.28) the application always throws 404 for any of the routes configured.
Spring Boot 2.0 does not currently support WAR deployment for WebFlux applications.
See the Spring Boot issue you created: https://github.com/spring-projects/spring-boot/issues/12455

Spring webflux on tomcat

I just created a new application using Spring boot 2 M7 and I'm using spring-webflux.
I built the application as an autoexecutable war that I can start in dev with java -jar app.war and also on a standalone tomcat server for UAT purpose.
In the web reactive reference doc, I read
To deploy as a WAR to a Servlet 3.1+ container, wrap HttpHandler with ServletHttpHandlerAdapter and register that as a Servlet. This can be automated through the use of AbstractReactiveWebInitializer.
Baeldung site also wrote about it and they describe a procedure to register a servlet that wrap the router for a standalone environment.
Using Spring boot tomcat starter, I didn't need to do anything : no code about booting the server necessary ; the app starts using the embedded server. In debug I saw NIO access so all seems fine.
I didn't try yet but what will happen on a standalone tomcat using Spring boot tomcat starter and webflux starter ? Is spring boot take care of everything (embbeded and standalone tomcat) ? how does it work ?

Running multiple spring boot web app on tomcat

I am trying to deploy multiple spring boot web app on tomcat. All have the same application.properties.How can I split the configuration files for different app running on tomcat.
Spring Boot doesn't require an external Tomcat, because it contains its own embedded Tomcat. So you can run all of your application in it's own Tomcat on the same machine. All you have to do is to define different ports for your applications via server.port property.

Resources