You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
I am running the latest version (I'm using 15.0.0)
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
Current/Expected Behavior
I have a Spring Boot application with Spring Boot 2.6.5 and added com.github.kagkarlsson:db-scheduler-spring-boot-starter:15.0.0 and I'm successfully running multiple scheduled tasks.
I am now trying to add two simple APIs e.g. GET /scheduled_tasks and POST /scheduled_tasks/launch for Admin users to list/trigger the scheduled tasks.
However, I am struggling to inject the scheduler dependency into my controller/service.
***************************
APPLICATION FAILED TO START
***************************
Description:
Field schedulerClient in backend.services.ScheduledTasksService required a bean of type'com.github.kagkarlsson.scheduler.SchedulerClient' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type'com.github.kagkarlsson.scheduler.SchedulerClient'in your configuration.
I have also tried to use a custom BeanUtil to load the scheduler, as suggested in this issue :
This allows me to start the application, but when I actually try to call the API, I'm getting:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type'com.github.kagkarlsson.scheduler.Scheduler' available\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)\n\tat org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1175)\n\tat backend.util.BeanUtil.getBean(BeanUtil.kt:24)\n\tat
The irritating thing is that when I run the application without bootJar, it works. When I compile via bootJar, I get the errors above.
I am pretty sure it's a misconfiguration with the bootJar, but I can't figure out how to fix it.
I tried to search issues and discussions here, and googled for other information, but couldn't fix it.
I would highly appreciate if someone could point me in the right direction. 🙏🏻
The text was updated successfully, but these errors were encountered:
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
15.0.0
)Current/Expected Behavior
I have a Spring Boot application with Spring Boot
2.6.5
and addedcom.github.kagkarlsson:db-scheduler-spring-boot-starter:15.0.0
and I'm successfully running multiple scheduled tasks.I am now trying to add two simple APIs e.g.
GET /scheduled_tasks
andPOST /scheduled_tasks/launch
for Admin users to list/trigger the scheduled tasks.However, I am struggling to inject the scheduler dependency into my controller/service.
I have first tried the following code:
which results in
I have also tried to use a custom
BeanUtil
to load the scheduler, as suggested in this issue :This allows me to start the application, but when I actually try to call the API, I'm getting:
The irritating thing is that when I run the application without bootJar, it works.
When I compile via bootJar, I get the errors above.
My bootJar configuration is the following:
I am pretty sure it's a misconfiguration with the bootJar, but I can't figure out how to fix it.
I tried to search issues and discussions here, and googled for other information, but couldn't fix it.
I would highly appreciate if someone could point me in the right direction. 🙏🏻
The text was updated successfully, but these errors were encountered: