Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskExecutor not initialized in task namespace [SPR-6444] #11110

Closed
spring-projects-issues opened this issue Nov 24, 2009 · 3 comments
Closed
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Dave Syer opened SPR-6444 and commented

TaskExecutor not initialized in task namespace. Adding this to the ExecutorBeanDefinitionPasrserTests:

FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
     public String call() throws Exception {
          return "foo";
     }
});
((ThreadPoolTaskExecutor)executor).execute(task);
assertEquals("foo", task.get());

results in

java.lang.IllegalStateException: ThreadPoolTaskExecutor not initialized
	at org.springframework.util.Assert.state(Assert.java:384)
	at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.getThreadPoolExecutor(ThreadPoolTaskExecutor.java:217)
	at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.execute(ThreadPoolTaskExecutor.java:239)
	at org.springframework.scheduling.config.ExecutorBeanDefinitionParserTests.defaultExecutor(ExecutorBeanDefinitionParserTests.java:61)
...

Affects: 3.0 RC2

Referenced from: commits e101611

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Fixed by adding a call to InitializingBean.afterPropertiesSet in the TaskExecutorFactoryBean.

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Assigning back to Mark so he can check if InitializingBean is the correct callback (didn't see a LIfecycle in there or anything).

@spring-projects-issues
Copy link
Collaborator Author

Mark Fisher commented

That looks correct to me. Thanks for catching the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant