Spring ApplicationListener is not receiving events

前端 未结 3 1413
死守一世寂寞
死守一世寂寞 2020-12-23 20:15

I have the following ApplicationListener:

package org.mycompany.listeners;

import org.springframework.context.ApplicationListener;
import org.springframewor         


        
3条回答
  •  时光取名叫无心
    2020-12-23 20:26

    ContextStartedEvent is published when you explicitly invoke ConfigurableApplicationContext.start() on the context. If you need an event that is published when context is initialized, use ContextRefreshedEvent.

    See also:

    • 3.13.2 Standard and Custom Events

提交回复
热议问题