Java error opening JAR on live server; works fine on local test.

Discussion in 'Plugin Development' started by Zonr_0, Sep 14, 2011.

Thread Status:
Not open for further replies.
  1. Hi, I'm at my wits end here on this problem, so I thought I'd open it up to the hive mind to see if anybody can shed some light on this error.

    I have a plugin I am writing, and all through development I have been testing it on a craftbukkit server local to my machine. Everything has been working as expected, and I have finished the alpha version for private and personal release.

    However, as soon as I move it to the live server, I have a problem. The live server is a servercraft hosted server, so I can't be too sure of the exact specs, but what I can surmise is listed below the main post. It is possible, and even somewhat probable that the problem is on their end, but if so, any insight before I go to customer support would be very helpful.

    In any case, on the live server, the plugin seems to fail to load. Examining the serverlog reveals the following stacktrace:

    2011-09-14 06:07:17 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-980-g4ed23b1-b1060jnks (MC: 1.7.3)
    2011-09-14 06:07:17 [SEVERE] Could not load 'plugins/PlayerProfiles.jar' in folder 'plugins': error in opening zip file
    	at Method)
    	at java.util.jar.JarFile.<init>(
    	at java.util.jar.JarFile.<init>(
    	at org.bukkit.plugin.SimplePluginManager.loadPlugin(
    	at org.bukkit.plugin.SimplePluginManager.loadPlugins(
    	at org.bukkit.craftbukkit.CraftServer.loadPlugins(
    	at org.bukkit.craftbukkit.CraftServer.<init>(
    	at net.minecraft.server.ServerConfigurationManager.<init>(
    	at net.minecraft.server.MinecraftServer.init(
    Until this point, I have had no problem with craftbukkit or bukkit plugins on the live server. Both the live and the local are running the exact same plugins.

    Github link to the plugin source:
    Note: Not included in the repository is PatPeter's SQLlite/MySQL wrapper library which can be found somewhere on the forums here.
    Uses build #804 of bukkit.

    Known Live Server Details:
    OS: Ubuntu
    Plugins: Basic Circuits 0.9, CommandBook 1.5.2, RedstoneChips 0.9, SensorLibrary 0.25, WorldEdit 4.6, WorldGuard 5.2.2
    Craftbukkit version git-Bukkit-0.0.0-980-g4ed23b1-b1060jnks (MC: 1.7.3)

    Local Server Details:
    OS: Windows 7 64 Bit Home Premium
    Plugins: Basic Circuits 0.9, CommandBook 1.5.2, RedstoneChips 0.9, SensorLibrary 0.25, WorldEdit 4.6, WorldGuard 5.2.2
    Craftbukkit version git-Bukkit-0.0.0-980-g4ed23b1-b1060jnks (MC: 1.7.3)
    JDK version 64 bit

    As above, any insight on this is appreciated. Thanks!
  2. It looks like the server is unable to parse the jar file correctly. Maybe Ubuntu fails to read the compression of the archive (though I've never heard of issues like that on a linux server ...).

    When you are using the "Export" method of eclipse, you could try negating the state of the "Compress contents of the Jar file" checkbox. You can find it in the export dialogue on the tab where you select your output classes and export destination.
    It's at the bottom under "Options". If it's enabled when you export, try disabling it and vice versa.

    If you're not compiling the jar like that, then search for a similar option for your method.

    Another thing could just be that the file is corrupt. Maybe the upload was interrupted at some point or another error occurred? Have you tried reuploading?
  3. Offline


    Maybe the jar file gets corrupted. If you have terminal access to the server try to issue the following command from within plugin directory

    gzip -d "PlayerProfiles.jar"
    and look if it is able to decompress the jar file.
  4. Offline


    I had something simmilar, reply tomorrow and I'll give you my code (too busy now).
  5. Thanks for the swift responses, compiling an uncompressed jar did not seem to work. I've tried re-compiling and re-uploading the jar several times with no luck. Unfortunately I do not have terminal access, but after downloading the uploaded jar and placing it in the local server plugin directory, it seems to work fine.

    Still no luck, hopefully Lolmewn will have the answer! : )
  6. Offline


    I didn't read the source yet (I'm at work) but you have different OS on the live / test server. Maybe you try to access the zip file with windows-style path seperator (which obviously doesn't work on linux/unix) instead of using java's File.seperator?
  7. Offline


    I've had this issue before, this is going to sound over simplified but, occasionally when that happens to me, actually deleting the file instead of overwriting/exporting to it fixes this issue for me.
    Good luck :)
Thread Status:
Not open for further replies.

Share This Page