java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)

Spring JIRA | Andy Piper | 8 years ago
  1. 0

    I raised http://jira.springframework.org/browse/SPR-5345, but it looks like this is a bug in Spring-DM, or at least a hole between the two projects. Spring prevents close() from being run while refresh() is active. It can do this by sychronizing both methids. Spring-DM on the other hand splits refresh into startRefresh()/completeRefresh() with a sync lock around both methods. The problem is that the mulitcast is initialized in the second phase, so something can call close() after startRefresh() has completed and get an error from the multicaster. Not quite sure what the correct solution is here. Original bug follows. In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does: if (context.isActive()) { context.close(); } you end up with this error: <09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic ationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228) at org.springframework.context.support.AbstractApplicationContext.close( AbstractApplicationContext.java:794) at org.springframework.osgi.extender.internal.activator.ContextLoaderLis tener$3.run(ContextLoaderListener.java:832) at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60) at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati ngTimerTask.java:66) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Spring-DM has exactly this kind of code and fails in exactly this way. Either the event should be silently dropped or isActive should be set at the end of refresh()

    Spring JIRA | 8 years ago | Andy Piper
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)
  2. 0

    In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does: if (context.isActive()) { context.close(); } you end up with this error: <09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic ationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228) at org.springframework.context.support.AbstractApplicationContext.close( AbstractApplicationContext.java:794) at org.springframework.osgi.extender.internal.activator.ContextLoaderLis tener$3.run(ContextLoaderListener.java:832) at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60) at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati ngTimerTask.java:66) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Spring-DM has exactly this kind of code and fails in exactly this way. Either the event should be silently dropped or isActive should be set at the end of refresh()

    Spring JIRA | 8 years ago | Andy Piper
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)
  3. 0

    In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does: if (context.isActive()) { context.close(); } you end up with this error: <09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic ationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228) at org.springframework.context.support.AbstractApplicationContext.close( AbstractApplicationContext.java:794) at org.springframework.osgi.extender.internal.activator.ContextLoaderLis tener$3.run(ContextLoaderListener.java:832) at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60) at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati ngTimerTask.java:66) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Spring-DM has exactly this kind of code and fails in exactly this way. Either the event should be silently dropped or isActive should be set at the end of refresh()

    Spring JIRA | 8 years ago | Andy Piper
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I raised http://jira.springframework.org/browse/SPR-5345, but it looks like this is a bug in Spring-DM, or at least a hole between the two projects. Spring prevents close() from being run while refresh() is active. It can do this by sychronizing both methids. Spring-DM on the other hand splits refresh into startRefresh()/completeRefresh() with a sync lock around both methods. The problem is that the mulitcast is initialized in the second phase, so something can call close() after startRefresh() has completed and get an error from the multicaster. Not quite sure what the correct solution is here. Original bug follows. In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does: if (context.isActive()) { context.close(); } you end up with this error: <09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic ationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228) at org.springframework.context.support.AbstractApplicationContext.close( AbstractApplicationContext.java:794) at org.springframework.osgi.extender.internal.activator.ContextLoaderLis tener$3.run(ContextLoaderListener.java:832) at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60) at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati ngTimerTask.java:66) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Spring-DM has exactly this kind of code and fails in exactly this way. Either the event should be silently dropped or isActive should be set at the end of refresh()

    Spring JIRA | 8 years ago | Andy Piper
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)
  6. 0

    In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does: if (context.isActive()) { context.close(); } you end up with this error: <09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic ationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228) at org.springframework.context.support.AbstractApplicationContext.close( AbstractApplicationContext.java:794) at org.springframework.osgi.extender.internal.activator.ContextLoaderLis tener$3.run(ContextLoaderListener.java:832) at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60) at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati ngTimerTask.java:66) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Spring-DM has exactly this kind of code and fails in exactly this way. Either the event should be silently dropped or isActive should be set at the end of refresh()

    Spring JIRA | 8 years ago | Andy Piper
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)

    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

      ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: org.springframework.os gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/* .xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApp licationEventMulticaster(AbstractApplicationContext.java:287) at org.springframework.context.support.AbstractApplicationContext.publis hEvent(AbstractApplicationContext.java:274) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:819) at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio nContext.doClose(AbstractOsgiBundleApplicationContext.java:206) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68 ) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus tomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2 13) at org.springframework.osgi.extender.internal.dependencies.startup.Depen dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx ecutor.java:345)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.doClose()
    2. Spring OSGi Core
      AbstractDelegatedExecutionApplicationContext.doClose
      1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228)
      1 frame
    3. Spring Context
      AbstractApplicationContext.close
      1. org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:794)
      1 frame
    4. org.springframework.osgi
      RunnableTimedExecution$MonitoredRunnable.run
      1. org.springframework.osgi.extender.internal.activator.ContextLoaderListener$3.run(ContextLoaderListener.java:832)
      2. org.springframework.osgi.extender.internal.util.concurrent.RunnableTimedExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60)
      2 frames
    5. Spring Context
      DelegatingTimerTask.run
      1. org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:66)
      1 frame
    6. Java RT
      TimerThread.run
      1. java.util.TimerThread.mainLoop(Timer.java:512)
      2. java.util.TimerThread.run(Timer.java:462)
      2 frames