![]() Node applicationsNode= dsNode.getNode("applications") Session jcrSession = getJcrSession(jcrURL) Log logger = LogFactory.getLog(FileExportService.class) Public class FileExportService String String String String pathIncomplete Please don't hesitate to ask more info :)įileExportService.java package ![]() I am giving the configuration and bean code below. I have also succeeded scheduling 1 month ago with the same version of Spring, so I believe its not a Spring version issue. Then a annotation on the method and that worked like a charm. ![]() I always add the spring task configuration, like a scheduler and the annotation-driven directive. I am in no way expert on the subject but I have already done the same configuration for scheduling in the past,for about 5-6 other projects. 12:00:10,372 - INFO .IntegrationMBeanExporter.As the title states, I have setup a scheduler in a spring web app and it seems to run in a loop, random times, starting with 8 invocations and then randomly adding. 12:00:10,372 - INFO .stroy - traceid= - Summary on shutdown: bean 'response' : Could not open JPA EntityManager for transaction nested exception is : EntityManagerFactory is closedĪt .JpaTransactionManager.doBegin(JpaTransactionManager.java:448) ~ BeanCreationNotAllowedException: Error creating bean with name 'inMemoryDatabaseShutdownExecutor': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)Īt .(DefaultSingletonBeanRegistry.java:208) ~ 12:00:01,256 - INFO .ThreadPoolTaskScheduler.shutdown - traceid= - Shutting down ExecutorService 'taskScheduler' 12:00:01,251 - INFO .stroy - traceid= - Closing JPA EntityManagerFactory for persistence unit 'default' 12:00:01,245 - INFO yy.preDestory - traceid= - preDestory 12:00:01,244 - INFO .ThreadPoolTaskExecutor.shutdown - traceid= - Shutting down ExecutorService 'applicationTaskExecutor' 12:00:01,237 - INFO .EventDrivenConsumer.stop - traceid= - stopped bean '_' 12:00:01,237 - INFO .PublishSubscribeChannel.adjustCounterIfNecessary - traceid= - Channel 'application-1.errorChannel' has 0 subscriber(s). There's an autoscaler in place which frequently starts/stops service instances, crashing while stopping is not an option.įrom this post Spring - Scheduled Task - Graceful Shutdown I take that it should be enough to add taskSchedulerCustomizer() as a subscriber to the 'errorChannel' channel It's vital that the DB and RabbitMQ are accessible until the scheduled method ends. The service uses spring-data for the DB and spring-cloud-stream for RabbitMQ. I'm trying to get a spring boot service to end gracefully.It has a method with a annotation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |