Codelanx / CodelanxLib

Library for Codelanx plugins. Public use is allowed, but must be credited
Other
14 stars 4 forks source link

Lang error #20

Closed hfreeb closed 8 years ago

hfreeb commented 8 years ago

When lang is attempted to be used, from my plugin and CodelanxLib internally this error is thrown:

[CL-Lib] Error parsing data file
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_91]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_91]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_91]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_91]
    at com.codelanx.commons.data.FileDataType.newInstance(FileDataType.java:295) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.InfoFile.init(InfoFile.java:138) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.DataHolder.get(DataHolder.java:66) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.InfoFile.getConfig(InfoFile.java:71) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.InfoFile.get(InfoFile.java:83) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.LangFile.get(LangFile.java:60) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.commons.config.LangFile.format(LangFile.java:73) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.codelanxlib.config.Lang.sendMessage(Lang.java:135) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.codelanxlib.command.CommandStatus.handle(CommandStatus.java:100) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at com.codelanx.codelanxlib.command.CommandNode.onCommand(CommandNode.java:167) [codelanxlib-0.3.1-20160626.140832-1.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:646) [spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.DedicatedServer.aL(DedicatedServer.java:437) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571) [spigot.jar:git-Spigot-687a019-4c1e934]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
Caused by: java.lang.NullPointerException
    at com.codelanx.commons.data.FileDataType.deserializeMap(FileDataType.java:351) ~[?:?]
    at com.codelanx.commons.data.FileDataType.<init>(FileDataType.java:88) ~[?:?]
    at com.codelanx.commons.data.types.Yaml.<init>(Yaml.java:32) ~[?:?]
    ... 23 more
[18:19:38] [Server thread/WARN]: Unexpected exception while parsing console command "setrank"
org.bukkit.command.CommandException: Unhandled exception executing command 'setrank' in plugin McTournaments-Bukkit v0.0.1-SNAPSHOT
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[spigot.jar:git-Spigot-687a019-4c1e934]
    at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.DedicatedServer.aL(DedicatedServer.java:437) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672) [spigot.jar:git-Spigot-687a019-4c1e934]
    at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571) [spigot.jar:git-Spigot-687a019-4c1e934]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
Caused by: com.codelanx.commons.util.exception.IllegalReturnException: Cannot return null from CommandNode#execute
    at com.codelanx.codelanxlib.command.CommandNode.onCommand(CommandNode.java:169) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-687a019-4c1e934]
    ... 8 more
Caused by: java.lang.NullPointerException
    at com.codelanx.commons.config.InfoFile.init(InfoFile.java:140) ~[?:?]
    at com.codelanx.commons.config.DataHolder.get(DataHolder.java:66) ~[?:?]
    at com.codelanx.commons.config.InfoFile.getConfig(InfoFile.java:71) ~[?:?]
    at com.codelanx.commons.config.InfoFile.get(InfoFile.java:83) ~[?:?]
    at com.codelanx.commons.config.LangFile.get(LangFile.java:60) ~[?:?]
    at com.codelanx.commons.config.LangFile.format(LangFile.java:73) ~[?:?]
    at com.codelanx.codelanxlib.config.Lang.sendMessage(Lang.java:135) ~[?:?]
    at com.codelanx.codelanxlib.command.CommandStatus.handle(CommandStatus.java:100) ~[?:?]
    at com.codelanx.codelanxlib.command.CommandNode.onCommand(CommandNode.java:167) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-687a019-4c1e934]
    ... 8 more

Also, my plugin's and Codelanx's internal lang are empty, even after server restarts.

1Rogue commented 8 years ago

Try deleting the empty files, does the error persist?

Ideally, you'd be looking for what corrupts the configuration files, this is more or less an aftereffect.

hfreeb commented 8 years ago

I have tried deleted the empty files as well as using a near empty plugin to send the lang files. Neither of these worked.

1Rogue commented 8 years ago

Can you post a reproducable example plugin causing this error?

hfreeb commented 8 years ago

https://gist.github.com/Desetude/5021da1a9950aaf7916409941170c5a2 Using the latest 0.3.1 version of codelanxlib from the public maven repo (http://repo.codelanx.com/content/repositories/public/com/codelanx/codelanxlib/0.3.1-SNAPSHOT/)

Throws this error: http://hastebin.com/itugiwatax.sm

1Rogue commented 8 years ago

Should have time to fix this either at the end of this week or next week.

hfreeb commented 8 years ago

Any update on this?

1Rogue commented 8 years ago

Been quite a bit busy, but since I've just finished a game update release, should have time to fix it as of next weekend.

1Rogue commented 8 years ago

Still being investigated, just noting that it's not forgotten

1Rogue commented 8 years ago

Good news, this was fixed in CodelanxCommons (the parent project of CodelanxLib):

https://github.com/Codelanx/CodelanxCommons/commit/072a091075db38e4b40496890ddc445b6cf005e5

It's being deployed now for CodelanxLib 0.3.2