Cannot use Spring autowire injection with Spring devtools
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
Research direction
Reproduce the failure with Spring Devtools reload enabled using the WorkerOptions configuration shown. Start with SpringTasksInjector.java and the decode path in TasksRunnerService.java, then trace the reported autowiring failure. Done means the task runs successfully with Spring autowire injection while Devtools reload is active.
Written by the indexing model from the issue text.
Description
Redis version
5.0.13
Redisson version
3.40.2
Redisson configuration
WorkerOptions
.defaults()
.workers(4)
.beanFactory(beanFactory)
// Defines task timeout since task execution start moment
.taskTimeout(60, TimeUnit.SECONDS)
.addListener(
object : TaskFailureListener {
override fun onFailed(
taskId: String,
exception: Throwable,
) {
Sentry.captureException(exception)
logger.error("Task $taskId failed", exception)
}
}
)
What is the Expected behavior?
Task runs successfully
What is the Actual behavior?
o.s.b.f.NoSuchBeanDefinitionException: No qualifying bean of type 'com.claravine.aimia.integration.inbound.orchestration.IntegrationJobListener' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at o.s.b.f.s.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:2139)
at o.s.b.f.s.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1589)
at o.s.b.f.s.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)
at o.s.b.f.a.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)
... 16 common frames omitted
Wrapped by: <#5bd27f55> o.s.b.f.UnsatisfiedDependencyException: Error creating bean with name 'null': Unsatisfied dependency expressed through field 'integrationJobListener': No qualifying bean of type 'com.claravine.aimia.integration.inbound.orchestration.IntegrationJobListener' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at o.s.b.f.a.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788)
at o.s.b.f.a.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)
at o.s.b.f.a.InjectionMetadata.inject(InjectionMetadata.java:146)
at o.s.b.f.a.AutowiredAnnotationBeanPostProcessor.processInjection(AutowiredAnnotationBeanPostProcessor.java:532)
at o.r.e.SpringTasksInjector.inject(SpringTasksInjector.java:38)
at o.r.e.TasksRunnerService.decode(TasksRunnerService.java:332)
... 11 common frames omitted
Wrapped by: <#4c799c21> j.l.IllegalStateException: Unable to initialize codec with ClassLoader parameter
at o.r.e.TasksRunnerService.decode(TasksRunnerService.java:337)
at o.r.e.TasksRunnerService.executeCallable(TasksRunnerService.java:205)
... 10 common frames omitted
Wrapped by: <#26055c7f> j.l.IllegalArgumentException: java.lang.IllegalStateException: Unable to initialize codec with ClassLoader parameter
at o.r.e.TasksRunnerService.executeCallable(TasksRunnerService.java:221)
at j.i.r.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at o.r.e.RedissonExecutorRemoteService.invokeMethod(RedissonExecutorRemoteService.java:106)
at o.r.RedissonRemoteService.lambda$executeMethod$14(RedissonRemoteService.java:453)
at j.u.c.Executors$RunnableAdapter.call(Unknown Source)
Additional information
This only happens when Spring Devtools reload is active
- Dominant language
- Java
- Stars
- 24.4k
- Forks
- 5.5k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redisson/redisson
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
IndexOutOfBoundsException in ContainsDecoder.decode from lock watchdog renewal (mutable args list aliased)Possibly taken @ronitgupta138 claimed this 45 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Maintainers usually reply within 2 days
-
skipResult() batch decoding can consume subsequent command replies and corrupt response alignmentMay be free again @Exar-lab claimed this 9 days ago, and no pull request is open. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
redisson/redisson#7446 · 2 comments ·
Maintainers usually reply within 2 days
-
RLock after a master switch: READONLY is retried, every retry runs the lock script on the new master, and tryLock() still throws the first READONLYPossibly taken @wozhenbang2004 claimed this 36 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
All issues in redisson/redisson
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
avaje/avaje-metrics#142 ·
-
As a developer using gamma, I would like a click-to-copy button for the client credentials, so it is easier to copy themPossibly taken @Portals claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Lincoln-cn/JAiRouter#1473 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
exercism/java-analyzer#379 ·