Can I start a ManagedThread in a Singleton Enterprise Java Bean?
问题 I'm trying to start a thread in a Singleton EJB but java.lang.IllegalStateException is being thrown. This is my (cut-down) class: Singleton @LocalBean @Startup public class WatcherEJB { @Resource(name = "concurrent/masterActionsThreadFactor") ManagedThreadFactory threadFactory; Thread watcherThread; @PostConstruct public void startUp() { //Setup the listener using the ThreadFactory watcherThread = threadFactory.newThread(new Runnable() { @Override public void run() { //System.out.println(