HELP I broken my Plugin

Discussion in 'Plugin Development' started by rene3233, Jan 26, 2011.

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

    rene3233

    Whenever I start my plugin I get the following error message



    Code:
    26.01.2011 15:04:14 org.bukkit.plugin.SimplePluginManager loadPlugins
    SCHWERWIEGEND: Could not load plugins\ServerSecurity.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:83)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:117)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:82)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:43)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:81)
            ... 8 more
    Caused by: java.lang.NullPointerException
            at com.bukkit.KingGenius.ServerSecurityBukkit.funktion.<init>(funktion.j
    ava:33)
            at com.bukkit.KingGenius.ServerSecurityBukkit.ServerSecurityBukkit.<init
    >(ServerSecurityBukkit.java:57)
            ... 13 more
    Kind regards Rene3233
    --- merged: Jan 26, 2011 2:30 PM ---
    here is my Server Security classe
    Code:
    
    package com.bukkit.KingGenius.ServerSecurityBukkit;
    
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Map.Entry;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.PlayerChatEvent;
    import org.bukkit.event.player.PlayerEvent;
    import org.bukkit.event.player.PlayerListener;
    import org.bukkit.Server;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.command.Command;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.PlayerChatEvent;
    import org.bukkit.event.player.PlayerListener;
    import org.bukkit.event.*;
    import org.omg.CORBA.PUBLIC_MEMBER;
    
    public class ServerSecurityBukkit extends JavaPlugin
    {
        Variablen veriablen = new Variablen();
        funktion funktions = new funktion(this);
        timer timer = new timer(this);
        funktionsfile funktionsfile = new funktionsfile(this);
        static Integer[] integerArray;
        //Links the BasicPlayerListener
        private final BasicPlayerListener playerListener = new BasicPlayerListener(this);
        //Links the BasicBlockListener
        private final BasicBlockListener blockListener = new BasicBlockListener(this);
        //Create the hashmap "basicUsers"
      private HashMap<String, Location> m_Homes = new HashMap<String, Location>();
    
      public ServerSecurityBukkit(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader)
      {
        super(pluginLoader, instance, desc, folder, plugin, cLoader);
    
      }
      public Server getserver(){
        return getServer();
      }
      public void onEnable()
      {
    
          System.out.println("geht");
          PluginManager pm = getServer().getPluginManager();
            //Create PlayerCommand listener
            pm.registerEvent(Event.Type.PLAYER_COMMAND, this.playerListener, Event.Priority.Normal, this);
            //Create BlockPlaced listener
            pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_JOIN,this.playerListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_MOVE,this.playerListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_QUIT,this.playerListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_ITEM,this.playerListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_DAMAGED,blockListener, Event.Priority.Normal, this);
            pm.registerEvent(Event.Type.BLOCK_INTERACT,blockListener, Event.Priority.Normal, this);
            funktionsfile.loadmaindata();
            funktionsfile.loadlanguage();
            funktionsfile.loadShop_System();
            funktionsfile.loadZone_Protected();
            funktionsfile.loadBlock_Spawn_on_Destory();
            funktionsfile.loadBlock_Protektion();
            funktionsfile.loadAuto_Save();
            funktionsfile.loadAuto_MSG();
            funktionsfile.loadTeamspeakData();
            funktionsfile.loadrules();
            timer.MinutenTimerStart(60000);
      }
    
      public void onDisable()
      {
        System.out.println("Goodbye world!");
      }
      public void onPlayerJoin(PlayerEvent event) {
      }
    }
    
    
     
  2. Offline

    Fifteen

    Your code seems okay, but onPlayerJoin(PlayerEvent event) should be in the player listener class. May I see your plugin.yml file?
     
  3. Offline

    rene3233

    I mean here. xml file
    ever thank you for your help if you need all of my classes say modest
    Code:
    name: ServerSecurityBukkit
    main: com.bukkit.KingGenius.ServerSecurityBukkit.ServerSecurityBukkit
    version: 1.1
    sorry for my bad english
     
  4. Offline

    Fifteen

    I had a similar issue and solved it by re-ordering the folders (com\KingGenius\ServerSecurityBukkit\ServerSecurityBukkit), changing plugin.yml (main: com.KingGenius.bukkit.ServerSecurityBukkit.ServerSecurityBukkit), then refreshing the project (right-click project -> refresh).

    This doesn't seem to work for everyone, though.
     
  5. Offline

    rene3233

    I do not know what to do now sorry.

    If I use this code:


    Code:
    Variablen veriablen = new Variablen();
    funktion funktions = new funktion(this);
    timer timer = new timer(this);
    funktionsfile funktionsfile = new funktionsfile(this);

    Take out then debugged access the plugin but I can not go to the other classes.
     
  6. Offline

    Fifteen

    Sorry, I don't understand what you're saying.
     
  7. Offline

    rene3233

    So I do not know what in the. xml is set to change. So which folder I should be merged.

    Besides, if I take out these lines of code is then the plugin so far but I no longer functions in my other classes can access.


    Code:
    Variablen veriablen = new Variablen();
    funktion funktions = new funktion(this);
    timer timer = new timer(this);
    funktionsfile funktionsfile = new funktionsfile(this);

    Do you think this card includes the icq I better go
     
  8. Offline

    Fifteen

    Wait, did you call it plugin.xml? If so, rename it to plugin.yml and rebuild. :p
     
  9. Offline

    rene3233

    I have devoted myself to say the yml
    --- merged: Jan 26, 2011 4:01 PM ---
    :rolleyes:
     
  10. Offline

    Fifteen

    Then, as I said earlier, re-arrange the folders, change the .yml, and refresh the project.

    1. Change the order of your folders to com\KingGenius\bukkit\ServerSecurityBukkit\
    2. Change the "main" property of your yml to this: com.KingGenius.bukkit.ServerSecurityBukkit.ServerSecurityBukkit
    3. Refresh the project by right-clicking it and selecting refresh in Eclipse
    4. Re-export
     
  11. Offline

    rene3233

    Hmm, unfortunately does not work here the error you have not even an idea as I said when I rausehme a code WORKS but then I come to the classes of functions of other

    Code:
    26.01.2011 17:15:39 org.bukkit.plugin.SimplePluginManager loadPlugins
    SCHWERWIEGEND: Could not load plugins\ServerSecurity.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:83)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:117)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:82)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:43)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.ClassNotFoundException: com.KingGenius.bukkit.ServerSecurit
    yBukkit.ServerSecurityBukkit
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:29)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:77)
            ... 8 more
    --- merged: Jan 26, 2011 4:20 PM ---
    if you have TeamViewer you can see my entire source
    --- merged: Jan 26, 2011 4:55 PM ---
    No one can remember a council
    --- merged: Jan 26, 2011 6:04 PM ---
    No one can remember a council
     
  12. Offline

    kazimir

    Add me on ICQ... i think i can help you. (109638102)
     
  13. Offline

    rene3233

    i have you add in icq
     
Thread Status:
Not open for further replies.

Share This Page