Spring boot embedded container - spring

We have to deploy our code to WAS 7.0. We have got our spring boot application to deploy to WAS.
WAS 7.0 uses the Servelet 2.5 spec and we have to use java 1.6 jdk.
I am having issues with running the junit / integration tests. The embedded container is a tomcat 7. Can I run the tests using a lower version of tomcat or jetty.

JHipster is based on Spring Boot, so it has its requirements as a minium.
You will need a Servlet 3.0 container
It's going to be difficult to have it work on JDK6
The whole point of JHipster is to have a "modern" application, so making it work on Websphere and JDK6 isn't our original goal.

Related

Upgrade tomcat for spring boot application

The application is created using spring boot version 1.2.5 Release. I can see that it includes an embedded tomcat version which is 8.0.23. Is it possible to upgrade to a recent tomcat version, let's say, tomcat 9 with spring boot 1.2.5 and still run the application? Or do we need to upgrade the spring boot version to be compatible with tomcat 9? Is there any documentation for the spring boot version compatibility with Tomcat? Thank you.
Why do you want to upgrade it? What is the newer version of tomcat going to bring?
I personally go with the defaults for the spring version unless there is a specific need or issue.
That being said this question may have some pointers
How to change embedded tomcat's version in existing spring boot app?
You may be able to just set the property
9.0.5
It would be preferable to upgrade to the latest Spring Boot release (currently 2.2.5-RELEASE) to avail yourself of the latest features. There are many tutorials, migration guides, problem solutions, etc., out there to guide you, of which here are just a couple:
https://spring.io/blog/2018/03/12/upgrading-start-spring-io-to-spring-boot-2
Global CORS configuration breaks when migrating to Spring Boot 2.0.x
You didn't specify a reason for keeping your Spring Boot version at 1.2.5-RELEASE and only upgrading tomcat, but if you really must, there are other answers, such as here: How to change embedded tomcat's version in existing spring boot app?

writing spring RESTful end point using java 1.4

Is there any way to develop spring based restful end point using jdk1.4(non annotation base approach because java 1.4 won't support) ?
I have oc4j server(oracle application server) version 10.1.3 which supports j2sdk 1.4 and servlet 2.4. I believe I won't be able to deploy a springboot restful web service in my oc4j server because of jdk1.4(minimum java version required for springboot is 1.6)
Yes I agree Spring Boot is not possible for my scenario. I am asking if it is possible to develop spring web-mvc using jdk 1.4 and servlet 2.4 version ?
You may need to use the XML based configurations for initializing spring context. A RESTful application can be built even without using Spring using Jersey or some other JAX-RS implementations, if you are not going to use any Spring capabilities.

Using Spring Framework Web when Tomcat is already installed and running

I am studying Spring Framework (all features) preparing to start some microservices and web applications for the first time. I am puzzled by the injection of Tomcat by Spring. If I buy Java hosting with Tomcat already running or set up tomcat to be already configured and supposedly running on a server, is this going to cause a conflict because it is also included in Spring? Or are we talking two different things where what is included in Spring is a connector to Tomcat instead of Tomcat itself?
I believe you are talking about Spring Boot which comes with bundled tomcat (JAR packing). If you package as a JAR, tomcat will be bundled but if you want to use your own tomcat or Jetty or whatever you should look at bundling as WAR file which will exclude tomcat bundling.
few pointers for you
https://spring.io/blog/2014/03/07/deploying-spring-boot-applications
https://therealdanvega.com/blog/2017/06/28/deploying-war-application-server-spring-boot

Deploy spring boot applications

I know spring boot applications can be deployed to production environments as war files. But what is the typical way of deploying spring boot applications? Does it only require a jvm, not a container?
The Spring Boot Project Page states that Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
Means by default, the Spring Boot maven or gradle plugin builds self-contained executable jars, that contain all dependencies and an embedded webserver, e.g. tomcat or jetty. The Spring Boot Getting Started doc gives you an introduction to that. Using this approach you just need a JVM to run your application. But you can also configure it to create war files if this is a better fit to your production environment.
Does it only require a jvm, not a container?
It can run anywhere Java is setup.
Spring Boot's use of embedded containers and why Spring chose to go the container-less route. Many of their main driving forces were ease of use while testing and debugging, and being able to deploy Spring-based Java applications to the cloud, or any other environment.
Rest can be found out in attached image.
Spring boot applications if they are serving web requests do require a container. You can either deploy them as a war inside a container such as tomcat/jetty. Or you can deploy them with embedded container, tomcat.

Deploy a spring boot war to websphere 7.5

I have a Spring boot war(ReESTful webservice with Spring) built using a gradle build. Initially I built an executable jar and then converted into war. But I am not able to deploy this on websphere 7.5 app server. It can be deployed on Websphere 8.0. I read that spring boot war built without having web.xml is only supported in WAS 8 or above. How can i convert this to a war file that can be deployed on WAS 7.5?
I read that I need to add a web.xml to the war, but what what should be the content of the web.xml so that it can load all the controllers?
Spring Boot doesn't support Servlet 2.5 officially, but it doesn't take a lot to make it work. You might find this useful: https://github.com/scratches/spring-boot-legacy.
You can get more information at the official documantation.

Resources