Error in Console when trying /trait shopkeeper
blablubbabcDEV opened this issue · 6 comments
Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/387
Originally posted by sleite (Apr 10, 2016):
What steps will reproduce the problem?
1. /trait shopkeeperWhat is the expected output? What do you see instead?Error message is deplayed. Command fails. Interesting to note that (previous) existing Citizens Shopkeepers still work (they were created with a previous version of Shopkeepers.jar).In game error message:Please report this error: [See console]
java.lang.IllegalArgumentException: Plugin cannot be nullWhat version of the product are you using?latest version of Spigot and Shopkeepers as at Apr 10, 2016Do you have an error log of what happened?2:18:32 AM [INFO] sleite issued server command: /trait shopkeeper
2:18:32 AM [WARN] java.lang.IllegalArgumentException: Plugin cannot be null
2:18:32 AM [WARN]Â Â Â at org.apache.commons.lang.Validate.notNull(Validate.java:192)
2:18:32 AM [WARN]Â Â Â at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:397)
2:18:32 AM [WARN]Â Â Â at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:123)
2:18:32 AM [WARN]Â Â Â at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.runTaskLater(CraftScheduler.java:106)
2:18:32 AM [WARN]Â Â Â at com.nisovin.shopkeepers.shopobjects.CitizensShopkeeperTrait.onAttach(CitizensShopkeeperTrait.java:94)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.trait.Trait.linkToNPC(Trait.java:46)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.npc.AbstractNPC.addTrait(AbstractNPC.java:99)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.npc.AbstractNPC.addTrait(AbstractNPC.java:88)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.commands.TraitCommands.addTrait(TraitCommands.java:64)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.commands.TraitCommands.toggle(TraitCommands.java:157)
2:18:32 AM [WARN]Â Â Â at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2:18:32 AM [WARN]Â Â Â at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2:18:32 AM [WARN]Â Â Â at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2:18:32 AM [WARN]Â Â Â at java.lang.reflect.Method.invoke(Unknown Source)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.command.CommandManager.executeMethod(CommandManager.java:152)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.command.CommandManager.execute(CommandManager.java:87)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.api.command.CommandManager.executeSafe(CommandManager.java:175)
2:18:32 AM [WARN]Â Â Â at net.citizensnpcs.Citizens.onCommand(Citizens.java:236)
2:18:32 AM [WARN]Â Â Â at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
2:18:32 AM [WARN]Â Â Â at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
2:18:32 AM [WARN]Â Â Â at org.bukkit.craftbukkit.v1_9_R1.CraftServer.dispatchCommand(CraftServer.java:645)
2:18:32 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.PlayerConnection.handleCommand(PlayerConnection.java:1350)
2:18:32 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:1185)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13)
2:18:33 AM [WARN]Â Â Â at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
2:18:33 AM [WARN]Â Â Â at java.util.concurrent.FutureTask.run(Unknown Source)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660)
2:18:33 AM [WARN]Â Â Â at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559)
2:18:33 AM [WARN]Â Â Â at java.lang.Thread.run(Unknown Source)
2:19:46 AM [WARN] Exception in thread "Craft Scheduler Thread - 530"
2:19:46 AM [WARN] org.apache.commons.lang.UnhandledException: Plugin WorldEditSelectionVisualizer v1.4.2 generated an exception while executing task 41Please provide any additional information below.Worked fine in previous version.
Originally commented by blablubbabc (Apr 10, 2016):
Make sure that the shopkeepers plugin is actually enabled currently.
The plugin cannot properly setup the shopkeeper for the trait attachment if shopkeepers is currently not running.
I will see if I can simply ignore the trait attachment if shopkeepers is currently not running, in order to prevent this error.
Originally commented by blablubbabc (Apr 10, 2016):
[at]sleite:
I don't think that the citizens reload is the problem here. I am pretty sure Shopkeepers wasn't enabled at the time you tried to add the shopkeeper trait to the npc.
The next time this happens you could see if Shopkeepers is in red color if you list your plugins via /pl
Edit: I made some changes: In the next update I unregister the shopkeeper trait again whenever shopkeepers or citizens gets disabled, so one shouldn't be able to create shopkeeper traits anymore if shopkeepers isn't running. And additionally it checks if shopkeepers is running before trying to setup a shopkeeper for a shopkeeper trait, just in case.
Edited Apr 10, 2016
Originally commented by blablubbabc (May 1, 2016):
The changes mentioned below are included in v1.72
Originally commented by sleite (Apr 10, 2016):
It is/was enabled. Although, I might have done a /citizens reload at some point. I'll restart my server and see if that corrects the problem.
Originally commented by sleite (Apr 10, 2016):
After a server restart, I was able to apply the shopkeeper trait without any issue. Strange. It must be a glitch with Citizens. I've noticed that when I do /citizens reload, any citizens that also have the trait of sentry, come back in duplicate. It's possible that is what might have happened.
After a full server restart, the problem disappears.
I was unable to duplicate the problem by performing a /citizens reload however. After the first reload, I was successful adding the /trait shopkeeper .. even though I was applying it to a Citizen / Sentry after a reload.
Sorry can't be of more help figuring out the problem.
Great plug-in by the way. Love it!