Spring cloud starter task : Not able to work on Spring boot 2.x - spring

I was trying to make spring boot batch application(2.0.0.RC1) work with Spring cloud starter task(2.0.0.M2).
Getting a range of errors while making Spring cloud starter task work with spring boot 2.x batch application.
I was able to run batch applicationspring-boot-starter-parent(1.5.10.RELEASE) with Spring cloud starter task(2.0.0.M2) successfully.
Here is the screeenshot
But when I tried Spring cloud starter task(2.0.0.M2) with spring boot 2.0.0.RC1, I am getting following error.
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id '' into a subtype of [simple type, class java.lang.Object]:
Here is the screenshot of the same.
So I decided to downgrade Spring boot to 2.0.0.M7.Alas I am getting a different exception.
java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#61f78561 has been closed already.
Why this exceptions happens?Any help/guide would be appreciated.

There have been quite a few upstream changes in Spring Boot, which caused side effects in Spring Cloud Task's 2.0.
We have had a all of them resolved (some in Boot itself) - see here.
We are targeting a 2.0 M3 release this week, so until that is done, perhaps you could try building 2.0 BUILD-SNAPSHOT locally. If you see any other anomaly, please let us know.

Related

How to check which Spring Boot version goes with spring-cloud-gcp-starter-data-spanner 1.1.0.RC1?

I intended to use Spring Data Cloud Spanner starter (version 1.1.0.RC1) with Spring Boot application but cannot find the official document of which Spring Boot version it goes with. Running my app and it works well with Spring Boot 2.x.x but not with Spring Boot version 1.x.x (ClassNotFoundException). Could anyone help:
Any document to show which SpringBoot version goes with Spring Data Cloud Spanner starter (version 1.1.0.RC1)?
Any way to make Data Cloud Spanner starter (ideally 1.1.0.RC1) work with SpringBoot version 1.5.17?
Thank you.
TL;DR Spring Boot 2.1 but you shouldn't have to care.
Spring Cloud Data Spanner is part of the Spring Cloud GCP project that recently joined the official Spring Cloud release train.
Rather than figuring out which version of a particular library is needed , I'd strongly recommend you to use proper dependency management in your build and let default apply. That way you can select a Spring Cloud generation (i.e. release train) and the dependencies that you need will be managed for you automatically (that is, no need to provide a version for them).
The latest 1.0 RC, RC2 at the time of writing, is part of the Greenwich release train with a RC2 release this week.
To get started with proper dependency management, go to https://start.spring.io and select "GCP Support" to get a build with the proper BOM import. Once you've done that you can add the starter without a version and things will be managed for you.
The relationships between Spring Boot version and Spring Cloud release train is documented here and on start.spring.io as well.

Do we really need to add spring boot starter web for spring boot admin clients?

Version 1.5.4 was working fine without extra declaration of starter web in POM of Spring Boot Admin Clients. When I upgraded to 2.0.1, I had to add starter web to POM to make it work. Without starter web in client apps, there is no error or no log related to registering the application.
It's not documented anywhere as far as I know. Can anyone please confirm?
Spring Boot Admin 2.x can run on netty and on tomcat. So if you want to run on tomcat you have to explicitly import the spring-boot-starter-web.
The getting started guide contains this dependency http://codecentric.github.io/spring-boot-admin/current/#set-up-admin-server

How do you write a Spring Cloud Config Server with Spring Boot (1.5.3.RELEASE) and Spring Cloud Config (1.3.0.RELEASE)?

I modified the spring-cloud-config-server-mongodb project to use the latest version of Spring Boot (1.5.3.RELEASE) and Spring Cloud Config (1.3.0.RELEASE).
I also introduced the class MongoConfigServer that runs the mongo db config server.
When I run it, I get this error:
org.springframework.beans.factory.NoUniqueBeanDefinitionException:
No qualifying bean of type
'org.springframework.cloud.config.server.environment.EnvironmentRepository' available:
more than one 'primary' bean found among candidates: [searchPathLocator, environmentRepository, searchPathCompositeEnvironmentRepository]
I am not sure what I did wrong. How do I write my own config server without getting this error?
I don't see any documentation on how to do this.
Can somebody please help me, or guide me?
This mongo db config server used to work with older versions of Spring Boot and Spring Cloud Config.
I am using this Mongo DB Config Server as an example for writing a different Config Server, which is also receiving the same error.
My fork of spring-cloud-config-server-mongodb is available at https://github.com/minmay/spring-cloud-config-server-mongodb.git
The spring-cloud-config-server-mongodb project has been upgraded to use spring-boot 1.5.7 snapshots.
I fixed this issue by updating https://github.com/minmay/spring-cloud-config-server-mongodb/blob/master/src/main/java/org/springframework/cloud/config/server/mongodb/config/MongoEnvironmentRepositoryConfiguration.java.
What I did was I removed the searchPathLocator bean, and removed the primary annotation from environmentRepository.
I guess Spring Cloud Config was updated to conditionally find an environmentRepository bean.

Spring Boot 1.4.0.RELEASE and Spring 4.3.2.RELEASE

I'm trying to update my project to Spring Boot 1.4.0.RELEASE and Spring 4.3.2.RELEASE but it fails with a following errors:
The project was not built since its build path is incomplete:
Cannot find the class file for org.springframework.core.io.support.PropertySourceFactory.
Cannot find the class file for org.springframework.core.NestedRuntimeException.
Does Spring Boot 1.4.0.RELEASE support Spring 4.3.2.RELEASE and if so what am I doing wrong and how to fix it ?
See my answer here for someone trying to do the same. You basically have to use dependency management to get your dependencies straight.

how to deploy Spring boot actuate application in external tomcat server

Im trying to just use the basic endpoints that comes with spring actuate and want to deploy in the external tomcat server without using spring boot. How to achieve this, could anyone help me please. Is there any configuration changes that I need to do. This website gives an idea but it uses older version of spring-boot-actuate. Also EndpointHandlerMapping and EndpointHandlerAdapter doesnt come with newer version of spring boot actuate.
Anyways I get 404 resource not found when deploying to the server.
Check out this question to see if it helps you. The Actuator component is a Spring Boot feature but you can use individual components within an existing application with the right build and configuration setups.

Resources