Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on startup in `Files.createNameIndex()` effectively disables plugin #89

Closed
totemo opened this issue Sep 4, 2019 · 4 comments

Comments

@totemo
Copy link

commented Sep 4, 2019

Affected RecipeManager versions: v2.17.1 and v.2.17.2 (current release)
Server version: PaperSpigot 172 and PaperSpigot 186 (latest):

NPE happens when trying to create default configuration, and apparently the unhandled exception is enough to prevent the plugin from supporting our one and only recipe when we try to add that after a restart.

Stack trace:

2019-09-04 08:00:40 [INFO] [RecipeManager] Parsed 0 recipe books.
2019-09-04 08:00:40 [INFO] [RecipeManager] §aGenerated 'messages.yml' file.
2019-09-04 08:00:40 [INFO] [RecipeManager] §aGenerated 'recipe flags.html' file.
2019-09-04 08:00:40 [INFO] [RecipeManager] §aGenerated 'commands & permissions.html' file.
2019-09-04 08:00:40 [WARN] Task #69 for RecipeManager v2.17.2 generated an exception
java.lang.NullPointerException: null
        at haveric.recipeManager.Files.createNameIndex(Files.java:519) ~[?:?]
        at haveric.recipeManager.Files.<init>(Files.java:82) ~[?:?]
        at haveric.recipeManager.Files.reload(Files.java:70) ~[?:?]
        at haveric.recipeManager.RecipeManager.reload(RecipeManager.java:180) ~[?:?]
        at haveric.recipeManager.RecipeManager.onEnablePost(RecipeManager.java:127) ~[?:?]
        at haveric.recipeManager.RecipeManager.access$000(RecipeManager.java:42) ~[?:?]
        at haveric.recipeManager.RecipeManager$1.run(RecipeManager.java:106) ~[?:?]
        at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.14.4.jar:git-Paper-186]
        at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:452) ~[patched_1.14.4.jar:git-Paper-186]
        at net.minecraft.server.v1_14_R1.MinecraftServer.b(MinecraftServer.java:1148) ~[patched_1.14.4.jar:git-Paper-186]
        at net.minecraft.server.v1_14_R1.DedicatedServer.b(DedicatedServer.java:417) ~[patched_1.14.4.jar:git-Paper-186]
        at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:1075) ~[patched_1.14.4.jar:git-Paper-186]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:919) ~[patched_1.14.4.jar:git-Paper-186]
        at java.lang.Thread.run(Thread.java:835) [?:?]

The recipe, though as noted this doesn't come into play. The exception happens when the plugin is creating its configuration files on first run.

CRAFT heart_of_the_sea
cyan_dye + cyan_dye + cyan_dye
cyan_dye + air + cyan_dye
cyan_dye + cyan_dye + cyan_dye
= heart_of_the_sea
@ingredientcondition cyan_dye | name &3Glistening Heart Fragment | enchant arrow_infinite 1
@haveric

This comment has been minimized.

Copy link
Owner

commented Sep 4, 2019

I'm unable to replicate this. Do you have any other plugins (or datapacks) enabled, specifically any that would add Enchantments?

@totemo

This comment has been minimized.

Copy link
Author

commented Sep 5, 2019

Oh! One of our plugins does indeed add a custom enchantment. It has, however been doing that for few years now and we have been running RecipeManager successfully in that time period as well.

@totemo

This comment has been minimized.

Copy link
Author

commented Sep 5, 2019

Looking further at it, I can see that the EnchantmentTarget is null. I'm due to do some maintenance on that plugin soon. Thanks for the pointer.

@totemo totemo closed this Sep 5, 2019

@haveric

This comment has been minimized.

Copy link
Owner

commented Sep 5, 2019

Ah, good to hear. It looks like there was a check in place for the 1.12 and older path for an empty EnchantmentTarget so it must be fairly new. I'll add an extra check on the 1.13+ side just in case though, which should get added to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.