Alan-Gomes / mcspring-boot

A Spring boot starter for Bukkit/Spigot/PaperSpigot plugins
MIT License
78 stars 25 forks source link

Server closing after reload finishes #6

Closed CC007 closed 5 years ago

CC007 commented 5 years ago

When I do the /reload command in mc 1.13 with a plugin configured to use your api (as per your README), the server correctly reloads, but after it is done with the reload, it acts as if the /stop command is issued.

[21:59:03 INFO]: CC007 issued server command: /reload
[21:59:03 INFO]: CC007: Please note that this command is not supported and may cause issues when using some plugins.
[21:59:03 INFO]: CC007: If you encounter any issues please use the /stop command to restart your server.
[21:59:03 INFO]: Debug logging is disabled
[21:59:03 INFO]: Server Ping Player Sample Count: 12
[21:59:03 INFO]: Using 4 threads for Netty based IO
[21:59:03 INFO]: -------- World Settings For [world] --------

...

[21:59:06 INFO]: Loaded 524 recipes
[21:59:08 INFO]: [HeadsPluginAPI] Loading HeadsPluginAPI v2.0.0-SNAPSHOT
[21:59:08 INFO]: [HeadsPluginAPI] Enabling HeadsPluginAPI v2.0.0-SNAPSHOT
[21:59:08 INFO]: 21:59:08.681 [Server thread] DEBUG org.springframework.core.env.StandardEnvironment - Activating profiles []

[21:59:08 INFO]:   .   ____          _            __ _ _
[21:59:08 INFO]:  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
[21:59:08 INFO]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[21:59:08 INFO]:  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
[21:59:08 INFO]:   '  |____| .__|_| |_|_| |_\__, | / / / /
[21:59:08 INFO]:  =========|_|==============|___/=/_/_/_/
[21:59:08 INFO]:  :: Spring Boot ::

...

[21:59:09 INFO]: 21:59:09.499 [Server thread] INFO org.springframework.boot.SpringApplication - Started application in 0.912 seconds (JVM running for 608.745)

[21:59:09 INFO]: Server permissions file permissions.yml is empty, ignoring it
[21:59:09 INFO]: CC007: Reload complete.
[21:59:09 INFO]: Stopping server
[21:59:09 INFO]: [HeadsPluginAPI] Disabling HeadsPluginAPI v2.0.0-SNAPSHOT
[21:59:09 INFO]: 21:59:09.534 [Server thread] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@1c173391, started on Sat May 18 21:59:08 CEST 2019

[21:59:09 INFO]: Saving players
[21:59:09 INFO]: CC007 lost connection: Server closed
[21:59:09 INFO]: CC007 left the game
[21:59:09 INFO]: Saving worlds
[21:59:09 INFO]: Saving chunks for level 'world'/overworld
[21:59:09 INFO]: Saving chunks for level 'world_nether'/the_nether
[21:59:09 INFO]: Saving chunks for level 'world_the_end'/the_end
>Press any key to continue . . .

I have not implemented anything more than the required things (maven dependency, SpringBootApplication annotated class, and the JavaPlugin class with onEnable and onDisable)

CC007 commented 5 years ago

Also confirmed with 1.13.2

Alan-Gomes commented 5 years ago

Hello, this behavior is caused by Spring trying to dispose the Server bean, which causes it to shutdown. It was fixed in 0.10.1.

Thanks for reporting!