Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-19308

Concurrency resources are injected in EJB objects before running

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • Concurrency Utilities
    • None
    • ---
    • ---

      The following singleton fails to start properly, due to the scheduler not being in running state when the ejb's postcontruct callback is invoked:

      @Startup
      @Singleton
      public class StartupTest
      {
      	@Resource
      	private ManagedScheduledExecutorService managedScheduledExecutorService;
      
      	@PostConstruct
      	public void start()
      	{
      		managedScheduledExecutorService.scheduleAtFixedRate(new Runnable()
      		{
      
      			@Override
      			public void run()
      			{
      				System.out.println("DO STUFF");
      			}
      		}, 0, 1L, TimeUnit.MINUTES);
      	}
      }
      

              emartins@redhat.com Eduardo Martins
              emartins@redhat.com Eduardo Martins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: