Netbeans: Exporting a plugin that has reference to another project

Discussion in 'Plugin Development' started by Bobit, May 23, 2014.

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

    Bobit

    I have one class "TwoWayHashMapWithLists", which is in a separate netbeans project. I've put it as a project in the library of my plugin, and imported it seemingly successfully, but I get a stack trace when I run a server with it:

    Code:
    [09:44:52 ERROR]: Could not load 'plugins/ReignRpg.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: twowayhashmapwithlists/TwoWayHashMapWithLists
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    Caused by: java.lang.NoClassDefFoundError: twowayhashmapwithlists/TwoWayHashMapWithLists
        at io.github.InfuriatedBrute.ReignRpg.Skills.<init>(Skills.java:66) ~[?:?]
        at io.github.InfuriatedBrute.ReignRpg.ReignRpg.<init>(ReignRpg.java:44) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.6.0_65]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) ~[?:1.6.0_65]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) ~[?:1.6.0_65]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513) ~[?:1.6.0_65]
        at java.lang.Class.newInstance0(Class.java:357) ~[?:1.6.0_65]
        at java.lang.Class.newInstance(Class.java:310) ~[?:1.6.0_65]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        ... 9 more
    Caused by: java.lang.ClassNotFoundException: twowayhashmapwithlists.TwoWayHashMapWithLists
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202) ~[?:1.6.0_65]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.6.0_65]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190) ~[?:1.6.0_65]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306) ~[?:1.6.0_65]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ~[?:1.6.0_65]
        at io.github.InfuriatedBrute.ReignRpg.Skills.<init>(Skills.java:66) ~[?:?]
        at io.github.InfuriatedBrute.ReignRpg.ReignRpg.<init>(ReignRpg.java:44) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.6.0_65]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) ~[?:1.6.0_65]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) ~[?:1.6.0_65]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513) ~[?:1.6.0_65]
        at java.lang.Class.newInstance0(Class.java:357) ~[?:1.6.0_65]
        at java.lang.Class.newInstance(Class.java:310) ~[?:1.6.0_65]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
        ... 9 more
    
    Netbeans doesn't sense any errors, but the plugin won't even load!
     
  2. Offline

    chingo247

    The only thing i can think of is that you compile your programs without the dependent libraries. Try Right-Click your project -> properties -> sources -> add folder -> your libs folder.
     
  3. Offline

    mine-care

    I sugest u use eclipse
    Nd have u seated it to implement the other plugin?
    Also is the other plugin installed in the server?
     
  4. Offline

    Bobit

    mine-care

    It's not a plugin, just a (abstract edit: ) generic object.

    chingo247

    I don't want the plugin to ship with all of the resources: vault, craftbukkit, permissionsEx. I just want it to ship with this one abstract class. If all else fails, I could always copy-paste this class in...
     
  5. Offline

    Giant

    An alternative to your issue might to shade it in with Maven, although this most likely will take you a few headaches to get it set up properly. Or you could look into something as such.
     
    Bobit likes this.
Thread Status:
Not open for further replies.

Share This Page