0
我試圖用undertow.io API啓動一個簡單的api服務器。這是我的啓動代碼。Undertow無效的記錄器接口
this.server = Undertow.builder().addHttpListener(this.port, this.host).setHandler(new HttpHandler() {
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.getResponseSender().send("Hello World");
}
}).build();
this.server.start();
我會得到這個錯誤:
[22:26:46] [Server thread/ERROR]: Error occurred while enabling MWS v1.0-SNAPSHOT (Is it up to date?)
java.lang.ExceptionInInitializerError
at io.undertow.Undertow.start(Undertow.java:113) ~[?:?]
at me.ripes.mws.server.ApiServer.startServer(ApiServer.java:30) ~[?:?]
at me.ripes.mws.MWS.onEnable(MWS.java:20) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:271) ~[spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugin(CraftServer.java:376) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.enablePlugins(CraftServer.java:326) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.reload(CraftServer.java:750) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.Bukkit.reload(Bukkit.java:540) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchServerCommand(CraftServer.java:636) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at net.minecraft.server.v1_11_R1.DedicatedServer.aM(DedicatedServer.java:437) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [spigot-1.11.2.jar:git-Spigot-d276ab1-1f6c04c]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: Invalid logger interface io.undertow.UndertowLogger (implementation not found in [email protected])
at org.jboss.logging.Logger$1.run(Logger.java:2556) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_131]
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2529) ~[?:?]
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516) ~[?:?]
at io.undertow.UndertowLogger.<clinit>(UndertowLogger.java:59) ~[?:?]
... 19 more
我認爲這是有暗流記錄一個問題,但我不知道解決它。 請幫我:)
我發現[此消息](http://lists.jboss.org/pipermail/undertow-dev/2013-February/000155.html)與同樣的問題和[回覆](http://lists.jboss.org/pipermail/undertow-dev/2013-February/000157.html)表示重新編譯修復了它。 [這篇文章](https://developer.jboss.org/thread/222022?_sscc=t)評論說,一些「糟糕的工作區內依賴關係」打破了它,並通過禁用Maven依賴關係來解決。這些幫助? – Draco18s