Could not load Configuration from jar issue

Discussion in 'Plugin Development' started by PerezHD, Jan 4, 2015.

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

    PerezHD

    Hey guys, I am attempting to make a command and make the command display a message set into it from the config.yml. The issue is, it says that there is an unknown character in chat which I don't understand.

    LOG ERROR:
    Code:
    [22:21:31] [Server thread/ERROR]: [flexUtils] Cannot load configuration from jar
    org.bukkit.configuration.InvalidConfigurationException: unacceptable character '�' (0xFFFD) special characters are not allowed
    in "<string>", position 709
    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:209) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:157) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at com.flexprison.perezhd.utils.listeners.FlyRegionStopper.onMove(FlyRegionStopper.java:29) [flexUtils.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_71]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_71]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_71]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:236) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.PacketPlayInFlying.a(SourceFile:137) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.PacketPlayInPosition.handle(SourceFile:63) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:157) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.ServerConnection.c(SourceFile:134) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:258) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    Caused by: org.yaml.snakeyaml.reader.ReaderException: special characters are not allowed
    at org.yaml.snakeyaml.reader.StreamReader.checkPrintable(StreamReader.java:70) ~[craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:50) ~[craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:399) ~[craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55) ~[craftbukkit-devBuild3116.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks]
    ... 21 more
    1 3 1 [22:21:32] [Server thread/INFO]: PerezHD issued server command: /apply
    CONFIG:
    Code:
    # flexUtils Configuration File
    Applications:
    - '&c&lApply @ website'
    - '&c&lThx'
    # WorldGuard Region Fly Stopper Util:
    Regions:
    - Prison:PVP
    - Prison:FFA
    - Prison:FFASAFE
    - Prison:spartanpvptop
    - Prison:spartanpvp
    - Prison:spartanpvp2
    - Walls:Walls
    - Walls:wallssafe
    messages:
      enteredRegion: '&cFlying disabled, no fly zone!'
    # Blocks Broken Counter Items
    blocks-items:
    - DIAMOND_PICKAXE
    - IRON_PICKAXE
    - GOLD_PICKAXE
    - WOOD_PICKAXE
    - STONE_PICKAXE
    #
    # Giveall chat prefix
    giveall-prefix: '§8[§dGiveAll§8] '
    #Drop Party start delay:
    dp-delay: 15
    # End of configuration file, literally the end!
    Just ignore the bottom portion. Just look at the "Applications:"

    CODE:
    Code:
    package com.flexprison.perezhd.utils.commands;
    
    import java.util.List;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    
    import com.flexprison.perezhd.utils.Main;
    
    public class Apply
      implements CommandExecutor
    {
      Main main;
     
      public Apply(Main pl)
      {
        this.main = pl;
      }
     
      public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
      {
        Player p = (Player)sender;
        if (cmd.getName().equalsIgnoreCase("apply")){
            List<String> apply = this.main.getConfig().getStringList("Applications");
            for (String s : apply) {
              p.sendMessage(s.toString()
                      .replace("&", "§")
                      .replace("%player%", p.getName()));
            }
        }
        return false;
      }
    }
    
     
  2. Offline

    iRamonHD

    I think it has something to do with the Paragraph key,
    Try removing it, and if it didn't work, try for every other key (No numbers and letters).
    If this post helped you, please leave a like :).
    Cheers, Ramon.
     
  3. Offline

    mythbusterma

    @PerezHD

    Don't put special characters at position 709 in the file. It's pretty simple.
     
  4. Offline

    PerezHD

    Well I fixed before any one else came to reply as this being a while ago.
     
  5. Offline

    eyamaz

    <edit> unlocked as not necro. <.<
    I think I need more sleep...
     
    Last edited: Jan 15, 2015
Thread Status:
Not open for further replies.

Share This Page