ruanwenjun commented on code in PR #15861:
URL: 
https://github.com/apache/dolphinscheduler/pull/15861#discussion_r1569088238


##########
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java:
##########
@@ -27,21 +27,24 @@
 import org.apache.dolphinscheduler.common.lifecycle.ServerLifeCycleManager;
 import 
org.apache.dolphinscheduler.common.thread.DefaultUncaughtExceptionHandler;
 import org.apache.dolphinscheduler.common.thread.ThreadUtils;
+import 
org.apache.dolphinscheduler.plugin.registry.jdbc.JdbcRegistryAutoConfiguration;
 
+import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 
 import lombok.extern.slf4j.Slf4j;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.context.event.ApplicationReadyEvent;
 import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.event.EventListener;
+import org.springframework.context.annotation.FilterType;
 
-@SpringBootApplication
-@ComponentScan("org.apache.dolphinscheduler")
 @Slf4j
+@SpringBootApplication
+@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = {
+        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = 
JdbcRegistryAutoConfiguration.class)
+})

Review Comment:
   Since `AutoConfigureAfter` can only be used at AutoConfiguration which is 
not under the scan path, so we need to exclude this, we need to remove the 
ComponentScan here, we should scan the bean under alert, the bean in other 
package should be import manual. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to