Questions tagged [spring-context]
95 questions
0
votes
1 answer
Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.SpringApplication
I recently upgraded by spring boot to 2.6.6 following a RCE vulnerability. However, application fails to start giving the following error:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt…

Vishal Mahuli
- 337
- 3
- 6
- 13
0
votes
1 answer
Spring Context and Autowire configuration to copy production to test?
I need to write a utility that copies data from a Production to a Test environment to prepare a database for testing the application prior to a large refactoring.
I really need to re-use the existing application config files unchanged, so that I…

Alex R
- 11,364
- 15
- 100
- 180
0
votes
1 answer
Cannot access org.springframework.ui.velocity.VelocityEngineFactory Method setVelocityEngine()
i have upgraded my java web project from spring boot 1.5.22 to 2.6.6. During this Upgrade the Velocity package is not even deprecated, it got removed. I know that it is recommended to switch to FreeMarker, but as a quick fix i was trying to fix my…

Coru
- 3
- 2
0
votes
3 answers
Why do we use a qualifier when we can have a name for the bean?
Why do we use qualifiers with @Bean when we can have different names for different beans of the same type (class)?
@Bean
@Qualifier("fooConfig")
public Baz method1() {
}
Isn't the following code more clean?
@Bean("fooConfig")
public Baz method1()…

Saif
- 2,530
- 3
- 27
- 45
0
votes
1 answer
Spring-Boot Components from other jar are not in context
I have following situation. JDK 17, Spring-Boot: 2.6.2. A gradle multi-project. One project is a library (java-library, no spring boot plugin). Another project is a spring boot application with spring boot plugin. Generally, the spring dependency…

Dmitri Zamysloff
- 1
- 2
0
votes
1 answer
Merging two Spring Application Context without closing the first application context
In our application start-up, we are creating one application context having its own bean configuration xml. Then depending up on certain logic, we would need to dynamically load/import the second bean configuration into the existing application…

rockycres
- 71
- 8
0
votes
2 answers
FullyQualifiedAnnotationBeanNameGenerator not present in latest spring-context
I am using FullyQualifiedAnnotationBeanNameGenerator which comes from org.springframework:spring-context. With the latest pom upgrade I see this class is not present in spring-context jar. What is the substitute of this class now? I am using…

mitali
- 87
- 8
0
votes
0 answers
Issue for circular dependency Spring-context 5.3.9 to 5.3.13
I have updated my org.springframework:spring-context:5.3.9 to 5.3.13
and start getting issue for circular dependency.
My code look's like
```@Component("myMessageHandler")
public class MyMessageHandler…

Bhushan Phalak
- 73
- 7
0
votes
0 answers
Spring application context bean creation issue with latest spring version
I have a project which uses an old spring.jar (1.2.6),from this project, I am expected to call a newer version (spring version 5.0.7) spring boot project's method. Below is the way I am creating my bean in old version project.
I am getting…

user2000189
- 479
- 4
- 6
- 22
0
votes
1 answer
How can I configure DataBinder to use a specific Locale to match a comma as decimal separator?
I use a DataBinder to map values to objects like this:
final var binder = new DataBinder(target);
binder.setIgnoreUnknownFields(false);
binder.bind(new MutablePropertyValues(properties));
Now I have some strings which have a comma as decimal…

Datz
- 3,156
- 3
- 22
- 50
0
votes
1 answer
Spring Boot application context interferes with separate ClassPathXmlApplicationContext
Because I have to work with a legacy application, I want to use beans from a separate Spring context.
I create this separate Spring context with an XML beans definition like this:

Harold L. Brown
- 8,423
- 11
- 57
- 109
0
votes
0 answers
What is the equivalent of XML configuration inheritance into Java based configs?
I understand Spring has configuration based inheritance, that means I can create beans referencing another bean as parent and Spring will copy the properties defined to the child. I'm looking on how to do the same with Java-based Spring…

gusridd
- 864
- 10
- 16
0
votes
1 answer
can i use properties defined in application.yml to define new property values in spring in other application.yml?
Is it possible in Spring environment to define some properties like p1 in an application-profile1.yml and then refer to ${p1} in other properties in application.yml ?
Just like an inter dependency order but between properties/yml files or properties…

NicuMarasoiu
- 776
- 9
- 25
0
votes
0 answers
spring - how to set explicitly primary=false?
I am building a jar dependency that will create a bean of a type that is likely to exist already in the apps that will use that dependency.
I want to create a configuration spring class in the dependency to mark that bean as "secondary".
How can we…

Roxana
- 1,569
- 3
- 24
- 41