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

java.lang.NoClassDefFoundError #8

Closed
Rocologo opened this issue Jul 16, 2016 · 21 comments
Closed

java.lang.NoClassDefFoundError #8

Rocologo opened this issue Jul 16, 2016 · 21 comments

Comments

@Rocologo
Copy link

ActionBarAPI 1.5.2 fails onEnable on my server.

My server is Spigot 1.10.2

[10:53:17 ERROR]: Could not load 'plugins/ActionBarAPI-1.5.2.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R4/Packet
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.loadPlugins(CraftServer.java:297) [spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.java:202) [spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:540) [spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R4/Packet
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_91]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_91]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
... 6 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_7_R4.Packet
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_91]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_91]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_91]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_91]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.10.2.jar:git-Spigot-3996d7d-6b843d9]
... 6 more

@ConnorLinfoot
Copy link
Owner

What exact version of Spigot are you using? And what other plugins?

Works fine for me on the latest Spigot 1.10.2

@Rocologo
Copy link
Author

I use spigot 1.10.2 newly generated and >70 plugins. But I cant see how any plugin can make a "ClassNotFoundException" ?

It looks like you are including net.minecraft.server.v1_7_R4 ? This in an really old version. Right?

@ConnorLinfoot
Copy link
Owner

It's not including "net.minecraft.server.v1_7_R4" at all, the plugin get's your Bukkit NMS version and uses that, so somehow it's getting v1_7_R4 for your server.

@Rocologo
Copy link
Author

This is my server log on restart.

http://pastebin.com/etwK0xN0

I dont know if that helps?

@ConnorLinfoot
Copy link
Owner

Seeing other plugins detect your NMS version fine, I'll try and have a look tomorrow at what they do differently. Could you maybe privately upload your spigot.jar and send me a link over PM on Spigot? As I can see if it's a bug with a specific Spigot build or something.

@Rocologo
Copy link
Author

Sorry I uploaded the wrong log. Actually it is on my test server ActionBar fails. I use the test server to test my own plugin MobHunting. The good thing is that I have only a few plugins on the test server.

I have updated the pastebin with the actual log: http://pastebin.com/etwK0xN0

Take a look again.

@Rocologo
Copy link
Author

I am building Spigot 1.10.2 completely fresh again (But spigot was only 14 days old, so I dont think spigot is the problem?).

@Rocologo
Copy link
Author

This is the log with a fresh SpigtMC
http://pastebin.com/etwK0xN0

@ConnorLinfoot
Copy link
Owner

Does it work fine if you remove all the other plugins?

@Rocologo
Copy link
Author

@ConnorLinfoot
Copy link
Owner

I just started it with that Spigot build and just ActionBarAPI alone and it seems to be working fine for myself, I don't know how but I can only imagine another plugin causing some sort of bug :/

@Rocologo
Copy link
Author

Now I have only have PermissionsEx and Vault and it still fails.

Loading libraries, please wait...
[01:00:11 INFO]: Starting minecraft server version 1.10.2
[01:00:11 INFO]: Loading properties
[01:00:11 INFO]: Default game type: SURVIVAL
[01:00:12 INFO]: This server is running CraftBukkit version git-Spigot-078e2f8-7f9fbe5 (MC: 1.10.2) (Implementing API version 1.10.2-R0.1-SNAPSHOT)
[01:00:12 INFO]: Server Ping Player Sample Count: 12
[01:00:12 INFO]: Using 4 threads for Netty based IO
[01:00:12 INFO]: Debug logging is disabled
[01:00:12 INFO]: Generating keypair
[01:00:12 INFO]: Starting Minecraft server on :25565
[01:00:12 INFO]: Using epoll channel type
[01:00:12 INFO]: Set PluginClassLoader as parallel capable
[01:00:12 ERROR]: Could not load 'plugins/ActionBarAPI-1.5.2.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R4/Packet
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.craftbukkit.v1_10_R1.CraftServer.loadPlugins(CraftServer.java:297) [spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at net.minecraft.server.v1_10_R1.DedicatedServer.init(DedicatedServer.java:203) [spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:535) [spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_7_R4/Packet
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_91]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_91]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
... 6 more
Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_7_R4.Packet
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_91]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_91]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_91]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_91]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.10.2.jar:git-Spigot-078e2f8-7f9fbe5]
... 6 more
[01:00:12 INFO]: [PermissionsEx] Loading PermissionsEx v1.23.4
[01:00:12 INFO]: [Vault] Loading Vault v1.5.6-b49
[01:00:12 INFO]: [Vault] Enabling Vault v1.5.6-b49
[01:00:12 INFO]: [Vault] [Permission] PermissionsEx found: Waiting
[01:00:12 INFO]: [Vault] [Permission] SuperPermissions loaded as backup permission system.
[01:00:12 INFO]: [Vault] [Chat] PermissionsEx found: Waiting
[01:00:12 INFO]: [Vault] Enabled Version 1.5.6-b49
[01:00:12 INFO]: *
** Beginning UUID conversion, this may take A LONG time ****
[01:00:12 INFO]: Preparing level "world"
[01:00:12 INFO]: -------- World Settings For [world] --------
[01:00:12 INFO]: Cactus Growth Modifier: 100%
[01:00:12 INFO]: Cane Growth Modifier: 100%
[01:00:12 INFO]: Melon Growth Modifier: 100%
[01:00:12 INFO]: Mushroom Growth Modifier: 100%
[01:00:12 INFO]: Pumpkin Growth Modifier: 100%
[01:00:12 INFO]: Sapling Growth Modifier: 100%
[01:00:12 INFO]: Wheat Growth Modifier: 100%
[01:00:12 INFO]: NetherWart Growth Modifier: 100%
[01:00:12 INFO]: Vine Growth Modifier: 100%
[01:00:12 INFO]: Cocoa Growth Modifier: 100%
[01:00:12 INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
[01:00:12 INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
[01:00:12 INFO]: Mob Spawn Range: 4
[01:00:12 INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
[01:00:12 INFO]: Random Lighting Updates: false
[01:00:12 INFO]: Structure Info Saving: true
[01:00:12 INFO]: Max Entity Collisions: 8
[01:00:12 INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
[01:00:12 INFO]: Max TNT Explosions: 100
[01:00:12 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
[01:00:12 INFO]: Item Despawn Rate: 6000
[01:00:12 INFO]: Item Merge Radius: 2.5
[01:00:12 INFO]: Arrow Despawn Rate: 1200
[01:00:12 INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
[01:00:12 INFO]: View Distance: 10
[01:00:12 INFO]: Zombie Aggressive Towards Villager: true
[01:00:12 INFO]: Experience Merge Radius: 3.0
[01:00:12 INFO]: Nerfing mobs spawned from spawners: false
[01:00:12 INFO]: -------- World Settings For [world_nether] --------
[01:00:12 INFO]: Cactus Growth Modifier: 100%
[01:00:12 INFO]: Cane Growth Modifier: 100%
[01:00:12 INFO]: Melon Growth Modifier: 100%
[01:00:12 INFO]: Mushroom Growth Modifier: 100%
[01:00:12 INFO]: Pumpkin Growth Modifier: 100%
[01:00:12 INFO]: Sapling Growth Modifier: 100%
[01:00:12 INFO]: Wheat Growth Modifier: 100%
[01:00:12 INFO]: NetherWart Growth Modifier: 100%
[01:00:12 INFO]: Vine Growth Modifier: 100%
[01:00:12 INFO]: Cocoa Growth Modifier: 100%
[01:00:12 INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
[01:00:12 INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
[01:00:12 INFO]: Mob Spawn Range: 4
[01:00:12 INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
[01:00:12 INFO]: Random Lighting Updates: false
[01:00:12 INFO]: Structure Info Saving: true
[01:00:12 INFO]: Max Entity Collisions: 8
[01:00:12 INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
[01:00:12 INFO]: Max TNT Explosions: 100
[01:00:12 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
[01:00:12 INFO]: Item Despawn Rate: 6000
[01:00:12 INFO]: Item Merge Radius: 2.5
[01:00:12 INFO]: Arrow Despawn Rate: 1200
[01:00:12 INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
[01:00:12 INFO]: View Distance: 10
[01:00:12 INFO]: Zombie Aggressive Towards Villager: true
[01:00:12 INFO]: Experience Merge Radius: 3.0
[01:00:12 INFO]: Nerfing mobs spawned from spawners: false
[01:00:12 INFO]: -------- World Settings For [world_the_end] --------
[01:00:12 INFO]: Cactus Growth Modifier: 100%
[01:00:12 INFO]: Cane Growth Modifier: 100%
[01:00:12 INFO]: Melon Growth Modifier: 100%
[01:00:12 INFO]: Mushroom Growth Modifier: 100%
[01:00:12 INFO]: Pumpkin Growth Modifier: 100%
[01:00:12 INFO]: Sapling Growth Modifier: 100%
[01:00:12 INFO]: Wheat Growth Modifier: 100%
[01:00:12 INFO]: NetherWart Growth Modifier: 100%
[01:00:12 INFO]: Vine Growth Modifier: 100%
[01:00:12 INFO]: Cocoa Growth Modifier: 100%
[01:00:12 INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
[01:00:12 INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
[01:00:12 INFO]: Mob Spawn Range: 4
[01:00:12 INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
[01:00:12 INFO]: Random Lighting Updates: false
[01:00:12 INFO]: Structure Info Saving: true
[01:00:12 INFO]: Max Entity Collisions: 8
[01:00:12 INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
[01:00:12 INFO]: Max TNT Explosions: 100
[01:00:12 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
[01:00:12 INFO]: Item Despawn Rate: 6000
[01:00:12 INFO]: Item Merge Radius: 2.5
[01:00:12 INFO]: Arrow Despawn Rate: 1200
[01:00:12 INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
[01:00:12 INFO]: View Distance: 10
[01:00:12 INFO]: Zombie Aggressive Towards Villager: true
[01:00:12 INFO]: Experience Merge Radius: 3.0
[01:00:12 INFO]: Nerfing mobs spawned from spawners: false
[01:00:12 INFO]: Preparing start region for level 0 (Seed: 3395339909380574998)
[01:00:13 INFO]: Preparing spawn area: 72%
01:00:14 INFO: Preparing start region for level 1 (Seed: 3395339909380574998)
01:00:14 INFO: Preparing start region for level 2 (Seed: 3395339909380574998)
01:00:14 INFO: [PermissionsEx] Enabling PermissionsEx v1.23.4
01:00:14 INFO: [PermissionsEx] Initializing file backend
01:00:14 INFO: [PermissionsEx] Permissions file successfully reloaded
01:00:14 INFO: [Vault][Permission] PermissionsEx hooked.
01:00:14 INFO: [Vault][Chat] PermissionsEx_Chat hooked.
01:00:14 INFO: Server permissions file permissions.yml is empty, ignoring it

01:00:14 INFO: [Vault] Checking for Updates ...
[01:00:16 INFO]: [Vault] No new version available

@Rocologo
Copy link
Author

Rocologo commented Jul 18, 2016

If Actionbar can't work with PermissionsEx and Vault then you have a problem :-)
This is the two files I use for testing, I think they are both up to date

https://dl.dropboxusercontent.com/u/36067670/Minecraft/PermissionsEx-1.23.4.jar
https://dl.dropboxusercontent.com/u/36067670/Minecraft/Vault1.5.6.jar

@ConnorLinfoot
Copy link
Owner

Still working perfectly fine for me, something else on your end must be causing issues.

@ConnorLinfoot
Copy link
Owner

Not sure if you know much about Java/Bukkit but this is the line where it gets your NMS version - https://github.com/ConnorLinfoot/ActionBarAPI/blob/master/src/main/java/com/connorlinfoot/actionbarapi/ActionBarAPI.java#L33

@Rocologo
Copy link
Author

Rocologo commented Jul 19, 2016

I know alot but not everything. This myplugin https://www.spigotmc.org/resources/mobhunting.3582/

What about the Java then? Im on Oracle 8 - like recommened. https://www.spigotmc.org/wiki/spigot-installation/

@ConnorLinfoot
Copy link
Owner

Java 8 should be fine (I'm also using that) I'm also quite confused why you are getting that error on startup, the plugin doesn't try to do anything with the packets until you actually call the API methods.

What output do you get when you run "/about ActionBarAPI"?

@Rocologo
Copy link
Author

Your pom.xml uses 1.6. Im not sure if this can cause this problem?

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>

@Rocologo
Copy link
Author

I get

[11:27:55 INFO]: This server is not running any plugin by that name.
[11:27:55 INFO]: Use /plugins to get a list of plugins.

Because it fails in onEnable. ActionBarAPI never starts

@ConnorLinfoot
Copy link
Owner

ConnorLinfoot commented Jul 19, 2016

Java 6 wouldn't cause issues for newer versions, it just provides compatibility with older versions.

I really don't know what I can do, I can't replicate the issue and frankly I don't understand why the issue would even occur on the onEnable phase as nothing during the startup accesses the packets. If I edit the code and force an invalid NMS version I get an error when I try and use the API, but the plugin enables fine. http://pastebin.com/0Jyv9TyC

@Rocologo
Copy link
Author

Rocologo commented Aug 4, 2016

I have some more investigation.

Version 1.5.0 and version 1.5.1 starts fine on my server. So I think you must have made a change in V1.5.2, which is the root cause?

@Rocologo Rocologo mentioned this issue Aug 4, 2016
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

2 participants