alecgorge / jsonapi

A JSON API for Minecraft: http://forums.bukkit.org/threads/admn-info-jsonapi-v1-3-1-json-http-and-socket-api-for-controlling-a-server-740.14270/
http://mcjsonapi.com
MIT License
231 stars 88 forks source link

Compatibility with Minecraft 1.12 #501

Closed kikelkik closed 7 years ago

kikelkik commented 7 years ago

Could you please take a look at compatibility of your plugin with the newest MC version 1.12? Here's an error I get when trying to start my PaperSpigot 1.12 server. I whould very appreciate continue using your powerful plugin :)

[22:42:08] [Server thread/INFO]: [JSONAPI] Enabling JSONAPI v5.7.0 [22:42:08] [Server thread/INFO]: [JSONAPI] Logging to file: false [22:42:08] [Server thread/INFO]: [JSONAPI] Logging to console: false [22:42:08] [Server thread/INFO]: [JSONAPI] IP Whitelist = None, all requests are allowed. [22:42:08] [Server thread/ERROR]: Error occurred while enabling JSONAPI v5.7.0 (Is it up to date?) java.lang.NoSuchMethodError: org.apache.logging.log4j.core.layout.PatternLayout.createLayout(Ljava/lang/String;Lorg/apache/logging/log4j/core/config/Configuration;Lorg/apache/logging/log4j/core/pattern/RegexReplacement;Ljava/lang/String;Ljava/lang/String;)Lorg/apache/logging/log4j/core/layout/PatternLayout; at com.alecgorge.minecraft.jsonapi.streams.console.ConsoleStubAppender.<init>(ConsoleStubAppender.java:18) ~[?:?] at com.alecgorge.minecraft.jsonapi.streams.console.Log4j2ConsoleHandler.<init>(Log4j2ConsoleHandler.java:11) ~[?:?] at com.alecgorge.minecraft.jsonapi.JSONAPI.onEnable(JSONAPI.java:545) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.jar:git-Paper-1114] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) [patched_1.12.jar:git-Paper-1114] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [patched_1.12.jar:git-Paper-1114] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:378) [patched_1.12.jar:git-Paper-1114] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:328) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:441) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:402) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:340) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:283) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:615) [patched_1.12.jar:git-Paper-1114] at java.lang.Thread.run(Unknown Source) [?:1.8.0_111] [22:42:08] [Server thread/INFO]: [JSONAPI] Disabling JSONAPI v5.7.0 [22:42:08] [Server thread/ERROR]: Error occurred while disabling JSONAPI v5.7.0 (Is it up to date?) java.lang.NullPointerException: null at com.alecgorge.minecraft.jsonapi.JSONAPI.onDisable(JSONAPI.java:838) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[patched_1.12.jar:git-Paper-1114] at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:344) [patched_1.12.jar:git-Paper-1114] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:320) [patched_1.12.jar:git-Paper-1114] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [patched_1.12.jar:git-Paper-1114] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:378) [patched_1.12.jar:git-Paper-1114] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:328) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:441) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:402) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:340) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:283) [patched_1.12.jar:git-Paper-1114] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:615) [patched_1.12.jar:git-Paper-1114] at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]

dartasen commented 7 years ago

I'll submit a pull request soon for 1.12 compatibility in the afternoon 🔢

ChristopherLMiller commented 7 years ago

i really appreciate your contributions to help keep this working dartasen. I've not had luck compiling source myself so i rely on your help with the pull requests

dartasen commented 7 years ago

Glad to help 🔢

kikelkik commented 7 years ago

So how can I get your commits into the jsonapi.jar file? Sorry, I'm not that familiar with git(hub) yet.

dartasen commented 7 years ago

Just wait for merge and the update will appear on the CI Server there : https://ci.alecgorge.com/job/JSONAPI/

Spiikesan commented 7 years ago

Does the start error makes the plugin unusable ? Because I already have "[JSONAPI] [API Request] adminuser requested: players.online.limit([]){AUTHED, NOT ALLOWED}" for every request, event whitelisted ones... Sorry for my bad English

dartasen commented 7 years ago

@Spiikesan You can disable this feature, in config.yml Set "log-to-console" to false 👍

Spiikesan commented 7 years ago

The problem is not the log, it's the "NOT ALLOWED" :/

dartasen commented 7 years ago

Check the user you use to call method in users.yml and ensure that the user can access every methods 📟

alecgorge commented 7 years ago

I have submitted a fix and build 139 works for 1.11.2 and 1.12: https://ci.alecgorge.com/job/JSONAPI/139/

Spiikesan commented 7 years ago

Thank you very much :D