Redis: [23:40:53 ERROR]: Error occurred while disabling RedisSync v1.0.0 (Is it up to date?) org.buk

Discussion in 'Plugin Development' started by Neonplayed, Jul 28, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    Neonplayed

    Hello, Im trying to update something in a redis database on the plugin disable but get this error:
    Code:
    Error occurred while disabling RedisSync v1.0.0 (Is it up to date?)
    org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
            at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.validate(CraftScheduler.java:400) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:141) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:115) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:98) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.scheduler.BukkitRunnable.runTaskAsynchronously(BukkitRunnable.java:49) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at motive.brad.redissync.listeners.ServerListener.setStatus(ServerListener.java:83) ~[?:?]
            at motive.brad.redissync.Core.onDisable(Core.java:26) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:318) ~[spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:356) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:431) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:424) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.plugin.SimplePluginManager.clearPlugins(SimplePluginManager.java:465) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:833) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.Bukkit.reload(Bukkit.java:301) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:765) [spigot.jar:git-PaperSpigot-ea452ce]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:751) [spigot.jar:git-PaperSpigot-ea452ce]
            at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:344) [spigot.jar:git-PaperSpigot-ea452ce]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:308) [spigot.jar:git-PaperSpigot-ea452ce]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:646) [spigot.jar:git-PaperSpigot-ea452ce]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:551) [spigot.jar:git-PaperSpigot-ea452ce]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-PaperSpigot-ea452ce]
    My onDisable:
    Code:
        public void onDisable() {
            ServerListener.getInstance().setStatus("offline");
            getPool().destroy();
        }
    My setStatus:
    Code:
        public void setStatus(final String status) {
            new BukkitRunnable() {
                public void run() {
                    Jedis jedis = core.getPool().getResource();
                    Pipeline pipeline = jedis.pipelined();
                    jedis.hset("hub", "status", status);
                    pipeline.sync();
                    core.getPool().returnResource(jedis); //Return to pool
    
                }
    
            }.runTaskAsynchronously(core.getCore());
        }
    Thank you for any help <3
     
  2. Offline

    timtower Moderator Moderator

    @Neonplayed You can't start runnables when disabled, just do it on the main thread instead.
     
Thread Status:
Not open for further replies.

Share This Page