Bar api not working

Discussion in 'Plugin Development' started by moo3oo3oo3, Nov 15, 2014.

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

    moo3oo3oo3

    Stackrace

    Code:
    [12:04:05 INFO]: moo3oo3oo3 issued server command: /bar
    [12:04:05 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'bar'
    in plugin dimension v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[buk
    kit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    0) ~[bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServe
    r.java:701) ~[bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerCon
    nection.java:956) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java
    :817) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java
    :28) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat
    .java:47) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157
    ) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [bukk
    it.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:6
    67) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    60) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    58) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :469) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NoClassDefFoundError: me/confuser/barapi/BarAPI
            at me.moo3oo3oo3.dimension.onCommand(dimension.java:35) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[buk
    kit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            ... 13 more
    Caused by: java.lang.ClassNotFoundException: me.confuser.barapi.BarAPI
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_67]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_67]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_
    67]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_67]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:77) ~[bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:62) ~[bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_67]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_67]
            at me.moo3oo3oo3.dimension.onCommand(dimension.java:35) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[buk
    kit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            ... 13 more
    >
    Code

    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    2. if (cmd.getName().equalsIgnoreCase("bar") && sender instanceof Player) {
    3.  
    4. Player player = (Player) sender;
    5.  
    6. BarAPI.setMessage("testing");
    7.  
    8. player.chat("debug1");
    9.  
    10. return true;
    11.  
    12. }
    13.  
    14. return false;
    15. }
     
  2. Offline

    mine-care

    Caused by: java.lang.ClassNotFoundException: me.confuser.barapi.BarAPI
    You sure the barAPI is in the same folder as your plugin?
     
  3. Offline

    adam753

    Oh boy, ClassNotFoundException. That means that, for whatever reason, your plugin.jar can't find the class called BarAPI that you refer to in your code. Assuming you're getting BarAPI from an external .jar, double-check that it's in your project build path and is being included in the export, in the exact same way as bukkit.jar is.
     
  4. Offline

    moo3oo3oo3

    How to I include it in the export?

    it has to be in plugins folder?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  5. Offline

    Skionz

    moo3oo3oo3 Yes lol. You can always write your own "BarAPI" by using client side enderdragons.
     
  6. Offline

    moo3oo3oo3

    Which one are you replying to? Sending packets is a pain
     
  7. Offline

    Skionz

    moo3oo3oo3 You need to have BarAPI downloaded and installed for it to work and sending packets isn't that hard.
     
  8. Offline

    moo3oo3oo3

    I have bar api in my server folder. I hooked up the build path. It still doesn't work
     
  9. Offline

    Konato_K

    moo3oo3oo3 BarAPI it's a plugin, put it in the plugins folder.
     
  10. Offline

    moo3oo3oo3

    tried, still doesn't work
     
  11. Offline

    Skionz

    moo3oo3oo3 "doesn't work" doesn't tell us anything... Tell us what exactly is wrong and give us the stack-trace.
     
  12. Offline

    moo3oo3oo3

    I get the same error even with it in plugins folder
     
  13. Offline

    xTigerRebornx

    moo3oo3oo3 Make sure you've depend/soft-depended it in your plugin yml
     
  14. Offline

    moo3oo3oo3

    oh, that's probably why. I'll test it
     
Thread Status:
Not open for further replies.

Share This Page