我收到以下错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preTransactionHandlerPool' defined in class com.fg.transbridge.processor.spring.ContextConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException
我有
preTransactionHandlerPool
豆豆。@Bean(name = "preTransactionHandlerPool")
public ThreadPoolTaskExecutor preTransactionHandlerPool() {
LOGGER.info("Initializing preTransactionHandlerPool");
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setCorePoolSize(preTransCorePoolSize);
threadPoolTaskExecutor.setMaxPoolSize(preTransMaxPoolSize);
threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(preWaitForCompleteShutDown);
LOGGER.debug("Initiated preTransactionHandlerPool");
return threadPoolTaskExecutor;
}
这可能是什么原因?
非常感谢您的帮助。
谢谢
最佳答案
好的,找到正确的答案。该方法有一些错误。在我的情况下,值传递应该为setMaxPoolSize > setCorePoolSize
。