spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

When using Spring Shell, no ApplicationReadyEvent will be published

Open fionera opened this issue 5 years ago • 6 comments
trafficstars

When I use Spring Shell, the ApplicationReadyEvent will never be published and new SpringApplicationBuilder(Application.class).run(args) also never returns

fionera avatar Mar 02 '20 15:03 fionera

@Order(Ordered.HIGHEST_PRECEDENCE) can be used as a workaround, makes your Component/Listener run before the shell starts.

rmartinsanta avatar Mar 06 '20 11:03 rmartinsanta

I replaced the ApplicationStarter from SpringShell with a Lifecycle Component. That helped too and is better suited for the task :)

fionera avatar Mar 06 '20 11:03 fionera

I have the same problem. @fionera, could you describe your workaround in more detail?

comrada avatar May 18 '20 07:05 comrada

I disabled spring shell and made this class to start it. https://github.com/CleanstoneMC/Cleanstone/blob/master/src/main/java/rocks/cleanstone/console/InteractiveShellLifecycle.java

fionera avatar May 18 '20 10:05 fionera

I disabled spring shell and made this class to start it. https://github.com/CleanstoneMC/Cleanstone/blob/master/src/main/java/rocks/cleanstone/console/InteractiveShellLifecycle.java

How do you disable Spring Shell?

davidrochin avatar Sep 01 '20 00:09 davidrochin

@davidrochin You can disable it by setting the following in your application.yml

spring:
  shell:
    interactive:
      enabled: false

fionera avatar Sep 03 '20 22:09 fionera