Questions tagged [spring-context]

95 questions
1
vote
0 answers

How does JVM and spring container work together during objs or beans creation?

Spring container creates Beans by creating a DAG first and then instantiates the non-dependent beans before creating any beans that are dependent on other beans. This is fine and understood. Any beans that is are dependent on regular java objects /…
samshers
  • 1
  • 6
  • 37
  • 84
1
vote
1 answer

FileNotFoundException: class path resource cannot be opened because it does not exist

I'm trying to run Spring with openfire, but get this error: FileNotFoundException: class path resource [ForwarderApplicationConfiguration.class] cannot be opened because it does not…
Dmytro
  • 139
  • 1
  • 10
1
vote
0 answers

Dynamically inject beans without annotations

I want to generate objects based on the yaml file and inject it into the Spring container (like instantiating multiple DataSourceTransactionManager). The @Bean annotation does not meet the requirements. I can't get the configuration information to…
munan
  • 353
  • 1
  • 2
  • 9
1
vote
2 answers

spring-context and spring-web 4.2.4.RELEASE

Why I need to include spring-context in my new spring boot project to work ? I have this in my pom.xml org.springframework spring-context
1
vote
0 answers

Spring Boot Cache implementation with multiple keys

I have a service that searches the user by id, email, or username. Also, it can update or delete user by id. @Service public class UserService{ public User getUserByEmail(String email) { ... } public User getUserByUsername(String usern) {…
paradox
  • 303
  • 3
  • 16
1
vote
2 answers

NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.mail.MailSender'

I am trying to use MailSender in my ApplicationListener, by autowiring it SpringContext: package example.util.emailUtil; @Component public class PostUserListener implements ApplicationListener { @Autowired private MailSender…
Jelly
  • 972
  • 1
  • 17
  • 40
0
votes
1 answer

Spring batch task pod(jvm) is not automatically terminated after competition of task

Spring batch task pod(jvm) is not automatically terminated after the competition of the task. So, I thought to close the application context explicitly post-completion of the task by closing the context in afterJob method of JobExecutionListener…
0
votes
0 answers

IntelliJ all of Controllers could not autowired all of Services after context seperation

I'm using IntelliJ Ultimate 2019.1.3. few days ago, I fixed the setting for Transaction. but after that, every controllers show up this error(red underlines). [ Could not autowired. No beans of '~~Service' type found. ] however, it works fine. so…
0
votes
1 answer
0
votes
0 answers

Spring Framework ClassPathXmlApplicationContext Hangs

I did find this previous question but this does not seem to be my issue: Spring hangs when loading bean definitions The situation is with Spring Framework 5.3.29 under OpenJDK8. I have this code: System.out.println("Loading beans.xml from…
jwh20
  • 646
  • 1
  • 5
  • 15
0
votes
0 answers

Spring version upgrade from 3.0.7 to 5.3.27 - No qualifying bean of type available: expected at least 1 bean which qualifies as autowire candidate

I updated my application from spring 3.0.7RELEASE to 5.3.27, My application contains multiple bean definitions in context files. At every bean creation I get nested exception as follows…
0
votes
1 answer

Is there a way to get the current spring application context while debugging without using dependency injection nor ApplicationContextAware interface

What i am looking for is getting the spring application context somehow along the following lines : ApplicationContext ac = SomeSpringClass.getCurrentContext() // As you may notice, the SomeSpringClass is not real // it's just what i am looking for…
0
votes
0 answers

TransactionalEventListener will not be called in spring 3.0.7 or 3.1.0

The method of the @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) annotation will not be called. In the older version 3.0.6 it is working. A small example project can be found…
bkb1986
  • 1
  • 1
0
votes
2 answers

Using custom sequence generator from spring context

Hello i have this issue on a custom sequence generator that is not managed by spring context. This issue came to be when we migrated to hibernate 6 as well as spring-boot 3 and spring 6. The Problem I cannot seem to get the values from the property…
lemoncodes
  • 2,371
  • 11
  • 40
  • 66
0
votes
0 answers

Spring Boot import one autoconfiguration into another

I am trying to create a SB3 library that exports auto-configurations. Here is the simplified scenario: @AutoConfiguration @ConditionalOnWebApplication // some other conditions public class TopLevelAutoConfiguration…
crizzis
  • 9,978
  • 2
  • 28
  • 47