java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler]

Spring JIRA | tomas lin | 3 years ago
  1. 0

    We are trying to incorporate spring websockets into a Spring Boot application with a custom implementation that refreshes the SpringApplication. It seems that the implementation of SockJS instantiates two Task Schedulers: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler] If spring-websocket is disabled, everything seems to work fine. However, we run into a one TaskScheduler limitation of ScheduledAnnotationBeanPostProcessor whenever we try to refresh once we include the websocket functionality. It would be nice if spring-websockets played nice with SpringApplication.refresh. The error log is attached. 2014-02-28 15:12:37,956 ERROR com.netflix.server.base.BaseServer$UncaughtExceptionHandlerImpl:684 [main] [uncaughtException] from main java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler] at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:289) at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:72) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:142) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:616)

    Spring JIRA | 3 years ago | tomas lin
    java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler]
  2. 0

    We are trying to incorporate spring websockets into a Spring Boot application with a custom implementation that refreshes the SpringApplication. It seems that the implementation of SockJS instantiates two Task Schedulers: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler] If spring-websocket is disabled, everything seems to work fine. However, we run into a one TaskScheduler limitation of ScheduledAnnotationBeanPostProcessor whenever we try to refresh once we include the websocket functionality. It would be nice if spring-websockets played nice with SpringApplication.refresh. The error log is attached. 2014-02-28 15:12:37,956 ERROR com.netflix.server.base.BaseServer$UncaughtExceptionHandlerImpl:684 [main] [uncaughtException] from main java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler] at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:289) at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:72) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:142) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:616)

    Spring JIRA | 3 years ago | tomas lin
    java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler]
  3. 0

    Why does Spring 4 only allow one TaskScheduler in a context?

    Stack Overflow | 3 years ago | user2112901
    java.lang.IllegalStateException: More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [commonScheduler, communicationTaskScheduler]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SpringBean doesn't support Generics?

    wicket-users | 2 years ago | RedCarpet
    java.lang.IllegalStateException: More than one bean of type [ProductDao] found, you have to specify the name of the bean (@SpringBean(name="foo")) or (@Named("foo") if using @javax.inject classes) in order to resolve this conflict. Matched beans: carProductDao,phoneProductDao
  6. 0

    Eclipse Community Forums: Remote Application Platform (RAP) ยป Problem with RWTLifeCycle / disposed context and Jaas Example implemetation

    eclipse.org | 1 year ago
    java.lang.IllegalStateException: The context has been disposed. >> >> but only if i try to refresh a browser window after more than >> 30sekonds (session timeout?) >> i think its a wrong approach in my app but i do not know where. >> >> thanks for any suggestions >> phil >> >> Philipp Mohrenweiser schrieb: >>> Ok a little bit reading and i got it myself. i was using a singleton >>> i implemented myself... so it did not create another one but used the >>> same.. using SessionSingletonBase solved the problem. >>> >>> >>> public class MySingleton extends SessionSingletonBase { >>> public static MySingleton getInstance() { >>> return (MySingleton)getInstance(MySingleton.class); >>> } >>> // all the other stuff comes here >>> } >>> >>> I found it in the book Eclipse Rich Ajax Platform but nowhere in the >>> web, could someone tell me where to find such things ? i would also >>> like to collect and publish them in some wiki, the rap wiki seems to >>> be a good idea? >>> >>> thanks phil >>> >>> >>> >>> Philipp Mohrenweiser schrieb: Hello, I tried to implement a simple JAAS Callback Handler from the JAAS Tutorial with RAP. I got many things working. But i have a stange behavior if i try to open a second browser window (another session): The first time i request the URI i yust get a blank workbench, the second time the server goes into a exception loop (see end of post) I am not sure what i did wrong i think it is no bug in rwt i think its the way i am working with it. as far as i understand i should try to make sure aother session gets created for the other browser window. i thought its done but if i change the asyncexec call into an synced exec call i got other exceptions. Can you tell me where the new session is created, so i could try to do this explicitly and the display i use to show my jaashandlerdialog would perhabs use the right one. And is there any further documentation where i could find such topics? sincerely philipp a. mohrenweiser. async run: Authentication failed: org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadTerm inatedError at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLif eCycle.java:303)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      More than one TaskScheduler and/or ScheduledExecutorService exist within the context. Remove all but one of the beans; or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback. Found the following beans: [defaultSockJsTaskScheduler, messageBrokerSockJsTaskScheduler]

      at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent()
    2. Spring Context
      AbstractApplicationContext.finishRefresh
      1. org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:289)
      2. org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:72)
      3. org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
      4. org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
      5. org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776)
      5 frames
    3. Spring Boot
      EmbeddedWebApplicationContext.finishRefresh
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:142)
      1 frame
    4. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485)
      1 frame
    5. Spring Boot
      SpringApplication.refresh
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
      2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:616)
      2 frames