Solved Odd maven error

Discussion in 'Spigot Plugin Development' started by Incrementing, Mar 16, 2016.

  1. So I was using NametagEdit.jar in my maven project but I've recently created my own way of editing nametags.
    NametagEdit was no longer need so I removed nametagedit.jar from the /libs dir and from the pom.xml file.

    But now I get the following when NametagEdit isn't on the server (works fine when its on the server) even though no class makes any calls to NametagEdit nor is it still a dependency in maven.

    Code (Text):
    [22:49:25 ERROR]: Could not pass event AsyncPlayerChatEvent to aresHub v1.0
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerConnection.chat(PlayerConnection.java:1084) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1022) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66-internal]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66-internal]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_66-internal]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_66-internal]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66-internal]
    Caused by: java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
        at main.incrementing.pw.API.getAsyncResult(API.java:156) ~[?:?]
        at api.incrementing.pw.Player.getRank(Player.java:75) ~[?:?]
        at main.incrementing.pw.listeners.AsyncPlayerChatEventHandler.onChat(AsyncPlayerChatEventHandler.java:26) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66-internal]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66-internal]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66-internal]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66-internal]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 11 more
     
    Anyone got any ideas?
    I've tried recreating the maven project but still the same error.

    Update: pom is here sorry for not posting it before I'm an idiot.
     
    #1 Incrementing, Mar 16, 2016
    Last edited: Mar 17, 2016
  2. I don't think that's related to NametagEdit.
    So your problem is you're not shading Hikari in your jar. I don't use Maven but I'm pretty sure this would be useful: https://maven.apache.org/plugins/maven-shade-plugin/index.html on the left of the link there's examples too
     
  3. Wow, it's maven... how can anybody help you without your pom?
     
  4. Updated post.
     
  5. Do what RaringM said.
     
  6. Will take a look at shading now.
    Sorry I'm new to maven :D
     
  7. You also need to remove the scope of the Hikari dependency. If you leave it as provided it won't shade into the plugin.
     
  8. I was just about to ask why the shaded jar didn't have a com packge in it :)
    Mind reader?

    Update:
    Removing the Hikari dependency didn't work, the <dependencies> section just had to be above the <plugins> section.
     
    #8 Incrementing, Mar 17, 2016
    Last edited: Mar 17, 2016
    • Like Like x 1
  9. If anyone has a problem like this:
    Cause: It was working with nametagedit as the nametagedit.jar had Hikari shaded into it.
    Fix: I had to #Learn2Shade.
    Working pom.xml: http://pastebin.com/aPZVTFGq.

    Thanks for the help :)
     
    #9 Incrementing, Mar 17, 2016
    Last edited: Mar 17, 2016