Spring upgrade 2.6.3 property issue in xml configuration - spring

Recently we upgraded our apis to spring 2.6.3. Just after upgrade we noticed that spring xml beans which was reading properties from application yml file is not able to read values. If i downgrade my spring jars, the same bean xml works

Related

where does spring load the auto configuration files from

I have read some tutorial on old version of spring boot.
https://www.logicbig.com/tutorials/spring-framework/spring-boot/auto-config-mechanism.html
The boot configuration classes are loaded from
spring-boot-autoconfigure-1.4.2.RELEASE.jar!/META-INF/spring.factories
(in the file, search for the key
org.springframework.boot.autoconfigure.EnableAutoConfiguration)
https://github.com/spring-projects/spring-boot/blob/v1.4.4.RELEASE/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories It has "org.springframework.boot.autoconfigure.EnableAutoConfiguration"
My understanding is that spring loads/runs all these files defined by EnableAutoConfiguration in spring.factories. If the #Conditional* matches, the bean will be created.
But in the last 2.x version, there is no such property EnableAutoConfiguration
https://github.com/spring-projects/spring-boot/blob/2.7.x/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
where does spring load the auto configuration files from?
Updated:
I found them here:
https://github.com/spring-projects/spring-boot/blob/v2.7.4/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
Spring Boot 2.7 introduced a new ‘META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports’ file for registering auto-configurations, while maintaining backwards compatibility with registration in ‘spring.factories’. With Spring Boot 3.0 release, support for registering auto-configurations in ‘spring.factories’ has been removed in favor of the imports file.
we are using #SpringBootApplication annotations on spring boot project main class in which they have all others annotations.

Changes To Spring #Autowired From Spring Boot 2.5.6 to 2.6.2

We have a Spring Boot App packaged as a war file and deployed on Wildfly. When I update the Spring Boot version from 2.5.6 to 2.6.2, I see lots of exception with Spring Autowire of variables. The problems being reported are circular dependency.
Has something changes with new version of Spring that changes how the autowiring works? I tried to research and can find no mention to changes in that area.
Thanks
The thing is that with the new Spring Boot version, circular dependencies are not allowed by default. Check the release notes.
You can get back to the previous behaviour setting the following configuration:
spring.main.allow-circular-references: true
However, I would suggest you revisit the application design.

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.

Override Spring jar in Weblogic 12c

We have been facing an issue while overriding the Spring jar in Weblogic 12c. Basically we need to write a bean based on some 3rd party API calling their interfaces. Now they use Spring 2.5 jar for their own implementation. Since Weblogic inherently supports Spring 3.0 jar. As a result when we write our bean wrapping their interfaces and deploy it, it doesn't work. We replicated the issue by replacing Spring 2.5 jar with Spring 3 in local environment.
If we modify the server classpath to load the Spring 2.5 jar (preceding Spring 3.0), entire soa-infra application goes down, so what We wanted to know if it is possible to override the Spring jar only for our application itself? While loading the application it will override the Spring 3.0 jar with Spring 2.5 in the application context but server will keep using Spring 3.0?
Any ideas/suggestions highly appreciated!
Thanks,
Bhaskar
Try using prefer-application-packages in your weblogic.xml file.
<container-descriptor>
<prefer-application-packages>
<package-name>org.springframework</package-name>
<prefer-application-packages>
</container-descriptor>

Error while including bean from org.springframewrok.orm jar file in spring

I am trying to make a crud application using Spring MVC and JPA with hibernate as a service provider.I already have a working CRUD application using spring MVC and jdbc.So I decided to make changes in already built application only
But the problem is when i include any class from org.springframewrok.orm jar file in beans.xml of spring it gives me HTTP 404- resource not found error. What could be the possible reasons??
I am using org.springframewrok.orm 3.1.1 release file.

Resources