Solved Fanciful Error

Discussion in 'Plugin Development' started by dznSpencer, Aug 19, 2015.

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

    dznSpencer

    I've tried numerous things to try to fix this. Nothing has worked.

    Seems that the Maven way to grab repo & depend are down.

    Class:

    Code:
    package com.thelabmc.labmain.commands;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    
    import com.thelabmc.labmain.Main;
    
    import mkremins.fanciful.FancyMessage;
    
    public class Youtube implements CommandExecutor {
    
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    
            Player p = (Player) sender;
    
            if (!Main.plugin.getConfig().contains("Youtuber1.URL")) {
                Main.plugin.getConfig().set("Youtuber1.URL", "http://youtube.com/");
                Main.plugin.saveConfig();
            }
            if (!Main.plugin.getConfig().contains("Youtuber2.URL")) {
                Main.plugin.getConfig().set("Youtuber2.URL", "http://youtube.com/");
                Main.plugin.saveConfig();
            }
            if (!Main.plugin.getConfig().contains("Youtuber3.URL")) {
                Main.plugin.getConfig().set("Youtuber3.URL", "http://youtube.com/");
                Main.plugin.saveConfig();
            }
    
            if (p.hasPermission("Lab.Youtube")) {
                p.sendMessage("§f§l=====§r §cYoutube Channels §f§l=====");
                p.sendMessage(" ");
                new FancyMessage("test").toJSONString();
    
            }
            return true;
        }
    }
    
    Stacktrace:

    Code:
    [16:32:47 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'youtubers' in plugin LabMain v0.1
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-b73910a-726656b]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-b73910a-726656b]
            at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-b73910a-726656b]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_51]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_51]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-b73910a-726656b]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-b73910a-726656b]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
    Caused by: java.lang.NoClassDefFoundError: com/google/gson/JsonParser
            at mkremins.fanciful.FancyMessage.<clinit>(FancyMessage.java:773) ~[?:?]
            at com.thelabmc.labmain.commands.Youtube.onCommand(Youtube.java:37) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-b73910a-726656b]
            ... 14 more
    Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParser
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_51]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-b73910a-726656b]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-b73910a-726656b]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_51]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_51]
            at mkremins.fanciful.FancyMessage.<clinit>(FancyMessage.java:773) ~[?:?]
            at com.thelabmc.labmain.commands.Youtube.onCommand(Youtube.java:37) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-b73910a-726656b]
            ... 14 more
    >
     
  2. Offline

    mythbusterma

    I wonder what could cause a NoClassDefFoundError? Maybe it's because the class isn't found? Just a thought.

    Spigot doesn't have Google Commons in it.
     
  3. Offline

    dreamermike1

    G'day dznSpencer,

    Have you checked out this part of your Stacktrace?

    Looks like its pointing you to the line that constructs and translates your FancyMessage. I'd check there as part of your troubleshooting.
     
  4. Offline

    dznSpencer

    Yeah, there's nothing odd looking there.
    Although, In my ArrayWrapper I'm getting an error with the yellow,

    [​IMG]
     
  5. Offline

    mythbusterma

    @dznSpencer

    That's a warning that Eclipse is giving you. It can usually be ignored.

    Now, actually read my post above for the answer to your problem.
     
  6. Offline

    dznSpencer


    Alright. Well where can I find the "Google Commons"
     
  7. Offline

    mythbusterma

  8. Offline

    dznSpencer

    @mythbusterma GSON Is still missing & I've added depend. I tried the JAR too.
     
  9. Offline

    mythbusterma

    @dznSpencer

    You'd have to include the entire library in the exported jarfile of your plugin and make sure it's at the correct location.
     
Thread Status:
Not open for further replies.

Share This Page