Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For some reason i get a error . #14

Open
FiberSprite opened this issue Aug 30, 2013 · 9 comments
Open

For some reason i get a error . #14

FiberSprite opened this issue Aug 30, 2013 · 9 comments

Comments

@FiberSprite
Copy link

I get this error when i am using your api in my plugin for some reason .

18:31:30 [SEVERE] Error occurred while enabling FiberCore v0.1 (Is it up to date
?)
java.lang.NoClassDefFoundError: se/ranzdo/bukkit/methodcommand/CommandHandler
at me.FiberSprite.FiberCore.FiberCore.onEnable(FiberCore.java:41)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
.java:457)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
r.java:381)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(CraftServer.jav
a:282)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(CraftServer.
java:264)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.reload(CraftServer.java:60
5)
at org.bukkit.Bukkit.reload(Bukkit.java:275)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
23)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
9)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServe
r.java:523)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchServerCommand(Craf
tServer.java:512)
at net.minecraft.server.v1_6_R2.DedicatedServer.ar(DedicatedServer.java:
262)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:2
27)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:4
86)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java
:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:5
82)
Caused by: java.lang.ClassNotFoundException: se.ranzdo.bukkit.methodcommand.Comm
andHandler
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader
.java:80)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:53)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 17 more

@stephan-gh
Copy link

You have to include the classes in your plugin.

@FiberSprite
Copy link
Author

What class's ????

@coaster3000
Copy link
Contributor

facepalm

Question. How new to java are you?

@FiberSprite
Copy link
Author

Im saing what class's do i need to add to it ???? i was told just to add it to the build path then add the code and it should work .

@coaster3000
Copy link
Contributor

You have to embed all class files into your plugin for it to function
properly. Or if this library uses a plugin release now. If it does. The
server needs to be running the Plugin of (Library)

@zachoooo
Copy link

zachoooo commented May 6, 2014

I get the same error when I run this as a maven dependency. I shouldn't have to copy it all over.

@coaster3000
Copy link
Contributor

That is the way java works. Unless the library is running as a separate plugin. you MUST include the classes with your plugin.

@Ranzdo
Copy link
Owner

Ranzdo commented May 6, 2014

If you are building the jar with maven, you need to use the maven shade plugin in order for dependencies to be included in the "uberjar". It is also recommended that you rewrite the package of methodcommand classes so they don't clash with another plugin also including the library.

An example would be this (add this to your plugins tag):

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <configuration>
                <relocations>
                        <relocation>
                                <pattern>se.ranzdo.bukkit.methodcommand</pattern>
                                <shadedPattern>(yourpackagenamehere).se.ranzdo.bukkit.methodcommand</shadedPattern>
                        </relocation>
                </relocations>
        </configuration>
</plugin>

@coaster3000
Copy link
Contributor

That is a really nice example of maven code @Ranzdo 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants