katharosada / botchallenge

A Minecraft bukkit server plugin and Python client for scripting bots
MIT License
35 stars 6 forks source link

Can't launch on Archlinux #9

Closed microspace closed 9 years ago

microspace commented 9 years ago

Hello. I'm trying to lauch spigot server on Archlinux. I'm able to spawn robot, but when I give it a command from python script, I get this error:

[20:55:22 INFO]: micro issued server command: /spawnrobot
[20:55:31 WARN]: Failed to initialize a channel. Closing: [id: 0x7cbee057, /0:0:0:0:0:0:0:1:45048 => /0:0:0:0:0:0:0:1:26656]
java.lang.NoClassDefFoundError: com/google/protobuf/ExtensionRegistryLite

I've followed these instructions to lauch spigot server http://www.spigotmc.org/wiki/buildtools/#linux I've installed maven, ant and protobuf. I've compiled robominions plugin and placed it to plugins directory. What I'm I doing wrong?

katharosada commented 9 years ago

Hi microspace,

You haven't done anything wrong (that I can see) it seems I must've missed a step from the install instructions when I wrote them out. I didn't think that this would be necessary but when you install the protoc compiler, you also need to install the Java libraries for protocol buffers. So follow the Java install instructions from the proto source that you downloaded.

Please let me know if this works, since I'm currently on vacation and I'm not able to test it myself. Have a look at this conversation I am having with someone who is seeing the exact same problem: https://github.com/katharosada/botchallenge/pull/8

Note: do NOT install the Python protocol buffer libraries from source, only the Java ones :)

benjamingorman commented 9 years ago

See https://github.com/katharosada/botchallenge/issues/10

microspace commented 9 years ago

Thank you for response! I'm going to try in couple of days and write about results.

microspace commented 9 years ago

I don't understand anything. I give up.

benjamingorman commented 9 years ago

What is it you're struggling to understand? Maybe I can help you?

microspace commented 9 years ago

I've compiled protobuf source code from here https://github.com/google/protobuf. Now, when I try to build plugin, I get these errors: https://gist.github.com/microspace/e63a8cd912448e3f2d94 Next week I'm going to try challenge on ubuntu machine.

benjamingorman commented 9 years ago

The reason for this message is that you're using protobuf 3. You should use 2.5.0 instead. 2.5.0 Isn't available from the github repo but you can get it here: http://code.google.com/p/protobuf/downloads/list.

katharosada commented 9 years ago

OK! I found this myself when I upgraded to the latest version of spigot, it turns out it's nothing to do with Arch linux, it somehow broke with the new version. This is not a bug in spigot, it's because the plugin depends on the netty library and protobuf extension to netty. Since spigot (and Minecraft) already use netty, it was using the existing netty library and couldn't find the protobuf classes referenced from there. This is why adding the protobuf classes into spigot itself worked.

Fortunately with my latest commit, this is no longer necessary, I've shaded netty and protobufs under our own namespace so it can't be interfered with by the existing netty. You should be able to build and run the plugin without doing any weird hackery with the protobuf classes anymore. :)

katharosada commented 9 years ago

Just to be clear, this fixes the original reported bug, not the other error that microspace is seeing, which hopefully won't be an issue since you don't need to compile the protobuffer library anymore since the original bug is fixed.