Help! My plugin causes my server to crash.

Discussion in 'Plugin Development' started by kkaylium13, Nov 12, 2012.

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

    kkaylium13

    Hey, I am just doing my first plugin and all it does (well, is supposed to do) is post a little message when the player places a block. There doesn't seem to be any errors in my code, but when I try to use it, it causes my server to crash. I think it's from the plugin.yml file.

    I checked and there isn't any extra white spaces either.

    here is the crash file: (why does it say My Bad??? Weird.)
    Any Ideas?
    Thanks
     
  2. Offline

    HamOmlet

    Is there any particular reason as to why you're casting a String to a Map?
     
  3. Offline

    fireblast709

    kkaylium13 can you post the source code (and a stacktrace if you find any in the server.log)
     
  4. Offline

    gcflames5

    Somewhere you are doing something along the lines of:
    Code:
    String s = "Whatever its equal to";
    Map<String,String> map = (Map<String,String>) s;
    But we can't help with specifics if we don't have your code. Try to find something similar to this and post it if you are not comfortable posting all of your code.
     
  5. Offline

    kkaylium13

  6. Offline

    fireblast709

    I think I get it now. permissions is usually a map, not a String, so Bukkit tries to cast it.
    Code:
    main: com.gmail.kkaylium.plugins.testplugin.TestPlugin
    name: TestPlugin
    version: 0.1
    author: kkaylium
    description: Shows a message when a player places a block.
    you had no perms atm in your code, so I removed the block. Normally it is used to make blocks like this:
    example
    Code:
    permissions:
      doorman.*:
        children:
          doorman.knock: true
          doorman.kick: true
          doorman.ring: true
      doorman.knock:
        description: knock knock
        default: true
      doorman.kick:
        description: kick dat door in
        default: op
      doorman.ring: 
        description: ring the bell, if players are not near the door
        default: true
     
  7. Offline

    kkaylium13

    So I need to add Perms, or Just leave it empty?
     
  8. Offline

    fireblast709

    as you had no permissions, just use the first block I posted above (without the "permissions:')
     
  9. Offline

    kkaylium13

    I did that, but i am still getting errors. This is the line that i think may be the problem.
    p.sendMessage("You placed a " + bp.getType().toString());
     
  10. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Please provide us with the error you are now getting.
     
  11. Offline

    kkaylium13

    ---- Minecraft Crash Report ----
    // Ouch. That hurt :(

    Time: 12/12/12 11:38 AM
    Description: Exception in server tick loop

    java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:42)
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:202)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:227)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:205)
    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:51)
    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:111)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:398)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:856)


    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- System Details --
    Details:
    Minecraft Version: 1.4.5
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_09, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 969846808 bytes (924 MB) / 1029046272 bytes (981 MB) up to 1029046272 bytes (981 MB)
    JVM Flags: 2 total; -Xms1024M -Xmx1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Suspicious classes: $Proxy3[com.avaje.ebean.config.dbplatform.DatabasePlatform, SQLitePlatform], [com.google.common.base.Predicate, Function, Joiner, ...], [com.google.common.collect.ImmutableCollection, ImmutableList, Maps, ...], [com.google.common.io.Files, OutputSupplier, InputSupplier], [net.minecraft.server.ICommandListener, IMojangStatistics, IDataManager, ...], [org.apache.commons.lang.Validate], [org.bukkit.BlockChangeDelegate, World, Server, ...], [org.bukkit.block.BlockState], [org.bukkit.command.CommandSender, RemoteConsoleCommandSender, CommandException, ...], [org.bukkit.command.defaults.VanillaCommand, SaveCommand, SaveOnCommand, ...], [org.bukkit.configuration.ConfigurationSection, Configuration, MemorySection, ...], [org.bukkit.configuration.file.FileConfiguration, YamlConfiguration, FileConfigurationOptions, ...], [org.bukkit.configuration.serialization.ConfigurationSerializable, ConfigurationSerialization, DelegateDeserialization, ...], [org.bukkit.conversations.Conversable], [org.bukkit.craftbukkit.Main, LoggerOutputStream, CraftServer, ...], [org.bukkit.craftbukkit.enchantments.CraftEnchantment], [org.bukkit.craftbukkit.help.SimpleHelpMap, CommandAliasHelpTopic, HelpYamlReader, ...], [org.bukkit.craftbukkit.inventory.CraftItemStack, CraftRecipe, CraftShapedRecipe, ...], [org.bukkit.craftbukkit.libs.com.google.gson.JsonDeserializer, JsonParseException], [org.bukkit.craftbukkit.libs.jline.TerminalFactory, Terminal, Flavor, ...], [org.bukkit.craftbukkit.libs.jline.console.ConsoleReader, CursorBuffer, ConsoleKeys, ...], [org.bukkit.craftbukkit.libs.jline.console.completer.CompletionHandler, CandidateListCompletionHandler], [org.bukkit.craftbukkit.libs.jline.console.history.History, MemoryHistory], [org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader, Configuration, Log], [org.bukkit.craftbukkit.libs.joptsimple.OptionException, OptionParser, OptionSpec, ...], [org.bukkit.craftbukkit.libs.joptsimple.internal.AbbreviationMap, ReflectionException, Reflection, ...], [org.bukkit.craftbukkit.libs.joptsimple.util.KeyValuePair], [org.bukkit.craftbukkit.metadata.EntityMetadataStore, PlayerMetadataStore, WorldMetadataStore], [org.bukkit.craftbukkit.potion.CraftPotionEffectType, CraftPotionBrewer], [org.bukkit.craftbukkit.scheduler.CraftScheduler, CraftTask, CraftAsyncTask, ...], [org.bukkit.craftbukkit.updater.AutoUpdater, BukkitDLUpdaterService, DateDeserializer], [org.bukkit.craftbukkit.util.Waitable, ServerShutdownThread, TerminalConsoleHandler, ...], [org.bukkit.enchantments.Enchantment, EnchantmentWrapper], [org.bukkit.entity.Entity, LivingEntity, AnimalTamer, ...], [org.bukkit.event.Event, Cancellable], [org.bukkit.event.block.BlockEvent, BlockFadeEvent, BlockGrowEvent, ...], [org.bukkit.event.entity.EntityEvent, EntityInteractEvent, EntityDamageEvent, ...], [org.bukkit.event.hanging.HangingEvent, HangingPlaceEvent], [org.bukkit.event.painting.PaintingEvent, PaintingPlaceEvent], [org.bukkit.event.player.PlayerEvent, PlayerInteractEvent, PlayerFishEvent, ...], [org.bukkit.event.server.ServerEvent, MapInitializeEvent, ServerCommandEvent, ...], [org.bukkit.event.world.WorldEvent, WorldInitEvent, WorldSaveEvent, ...], [org.bukkit.help.HelpMap, HelpTopic, IndexHelpTopic, ...], [org.bukkit.inventory.ItemStack, Recipe, ShapedRecipe, ...], [org.bukkit.map.MapView], [org.bukkit.material.MaterialData, Tree, Directional, ...], [org.bukkit.metadata.Metadatable, MetadataStore, MetadataStoreBase], [org.bukkit.permissions.ServerOperator, Permissible, PermissionDefault], [org.bukkit.plugin.ServicesManager, PluginManager, SimpleServicesManager, ...], [org.bukkit.plugin.java.JavaPluginLoader, PluginClassLoader], [org.bukkit.plugin.messaging.PluginMessageRecipient, Messenger, StandardMessenger, ...], [org.bukkit.potion.PotionEffectType, PotionEffectTypeWrapper, PotionBrewer, ...], [org.bukkit.scheduler.BukkitScheduler, BukkitTask], [org.bukkit.util.Vector, BlockVector, Java15Compat, ...], [org.fusesource.hawtjni.runtime.Library], [org.fusesource.jansi.AnsiOutputStream, WindowsAnsiOutputStream, AnsiConsole, ...], [org.fusesource.jansi.internal.Kernel32, CONSOLE_SCREEN_BUFFER_INFO, COORD, ...], [org.yaml.snakeyaml.DumperOptions, ScalarStyle, FlowStyle, ...], [org.yaml.snakeyaml.composer.Composer, ComposerException], [org.yaml.snakeyaml.constructor.BaseConstructor, SafeConstructor, Constructor, ...], [org.yaml.snakeyaml.emitter.Emitable, Emitter, EmitterException, ...], [org.yaml.snakeyaml.error.YAMLException, MarkedYAMLException, Mark], [org.yaml.snakeyaml.events.Event, NodeEvent, ScalarEvent, ...], [org.yaml.snakeyaml.external.com.google.gdata.util.common.base.Escaper, UnicodeEscaper, PercentEscaper], [org.yaml.snakeyaml.introspector.PropertyUtils, BeanAccess], [org.yaml.snakeyaml.nodes.Node, CollectionNode, MappingNode, ...], [org.yaml.snakeyaml.parser.Parser, ParserImpl, ParserException, ...], [org.yaml.snakeyaml.reader.UnicodeReader, StreamReader, ReaderException], [org.yaml.snakeyaml.representer.BaseRepresenter, SafeRepresenter, Representer, ...], [org.yaml.snakeyaml.resolver.Resolver, ResolverTuple], [org.yaml.snakeyaml.scanner.Scanner, ScannerImpl, ScannerException, ...], [org.yaml.snakeyaml.serializer.Serializer, SerializerException], [org.yaml.snakeyaml.tokens.Token, AliasToken, ScalarToken, ...], [org.yaml.snakeyaml.util.UriEncoder, ArrayStack]
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    CraftBukkit Information:
    Running: CraftBukkit version git-Bukkit-1.4.5-R0.2-b2488jnks (MC: 1.4.5) (Implementing API version 1.4.5-R0.2) true
    Plugins: {}
    Warnings: DEFAULT
    Threads: { WAITING Finalizer: [java.lang.Object.wait(Native Method), java.lang.ref.ReferenceQueue.remove(Unknown Source), java.lang.ref.ReferenceQueue.remove(Unknown Source), java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)], RUNNABLE Attach Listener: [], RUNNABLE Signal Dispatcher: [], RUNNABLE Thread-6: [java.net.DualStackPlainSocketImpl.connect0(Native Method), java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source), java.net.AbstractPlainSocketImpl.doConnect(Unknown Source), java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source), java.net.AbstractPlainSocketImpl.connect(Unknown Source), java.net.PlainSocketImpl.connect(Unknown Source), java.net.SocksSocketImpl.connect(Unknown Source), java.net.Socket.connect(Unknown Source), java.net.Socket.connect(Unknown Source), sun.net.NetworkClient.doConnect(Unknown Source), sun.net.www.http.HttpClient.openServer(Unknown Source), sun.net.www.http.HttpClient.openServer(Unknown Source), sun.net.www.http.HttpClient.<init>(Unknown Source), sun.net.www.http.HttpClient.New(Unknown Source), sun.net.www.http.HttpClient.New(Unknown Source), sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source), sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source), sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source), sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source), org.bukkit.craftbukkit.updater.BukkitDLUpdaterService.fetchArtifact(BukkitDLUpdaterService.java:49), org.bukkit.craftbukkit.updater.BukkitDLUpdaterService.getArtifact(BukkitDLUpdaterService.java:28), org.bukkit.craftbukkit.updater.AutoUpdater$1.run(AutoUpdater.java:77)], RUNNABLE DestroyJavaVM: [], RUNNABLE Thread-5: [org.fusesource.jansi.internal.Kernel32._getch(Native Method), org.fusesource.jansi.internal.WindowsSupport.readByte(WindowsSupport.java:46), org.bukkit.craftbukkit.libs.jline.WindowsTerminal.readByte(WindowsTerminal.java:184), org.bukkit.craftbukkit.libs.jline.WindowsTerminal.access$000(WindowsTerminal.java:53), org.bukkit.craftbukkit.libs.jline.WindowsTerminal$1.read(WindowsTerminal.java:151), java.io.FilterInputStream.read(Unknown Source), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader$1.read(ConsoleReader.java:167), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:267), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:204), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:995), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:1167), net.minecraft.server.ThreadCommandReader.run(ThreadCommandReader.java:31)], RUNNABLE Listen thread: [java.net.DualStackPlainSocketImpl.accept0(Native Method), java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source), java.net.AbstractPlainSocketImpl.accept(Unknown Source), java.net.PlainSocketImpl.accept(Unknown Source), java.net.ServerSocket.implAccept(Unknown Source), java.net.ServerSocket.accept(Unknown Source), net.minecraft.server.DedicatedServerConnectionThread.run(DedicatedServerConnectionThread.java:62)], WAITING Snooper Timer: [java.lang.Object.wait(Native Method), java.lang.Object.wait(Object.java:503), java.util.TimerThread.mainLoop(Unknown Source), java.util.TimerThread.run(Unknown Source)], RUNNABLE Server thread: [java.lang.Thread.dumpThreads(Native Method), java.lang.Thread.getAllStackTraces(Unknown Source), org.bukkit.craftbukkit.CraftCrashReport.call(CraftCrashReport.java:28), net.minecraft.server.CrashReportSystemDetails.a(SourceFile:74), net.minecraft.server.CrashReport.h(CrashReport.java:43), net.minecraft.server.CrashReport.<init>(CrashReport.java:30), net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443), net.minecraft.server.ThreadServerApplication.run(SourceFile:856)], WAITING Reference Handler: [java.lang.Object.wait(Native Method), java.lang.Object.wait(Object.java:503), java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)], TIMED_WAITING Thread-4: [java.lang.Thread.sleep(Native Method), net.minecraft.server.ThreadSleepForever.run(SourceFile:52)],}
    Recent tasks from -31--1{}
    Profiler Position: N/A (disabled)
    Is Modded: Definitely; Server brand changed to 'craftbukkit'
    Type: Dedicated Server (map_server.txt)
     
Thread Status:
Not open for further replies.

Share This Page