Weird error, seems to be started in Notch's code:

Discussion in 'Plugin Development' started by Everdras, Aug 3, 2011.

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

    Everdras

    Code:
    2011-08-03 11:58:50 [SEVERE] java.lang.NullPointerException
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.EntityLiving.v(EntityLiving.java:711)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.World.cleanUp(World.java:1104)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    2011-08-03 11:58:50 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-08-03 11:58:50 [SEVERE] Unexpected exception
    java.lang.NullPointerException
        at net.minecraft.server.EntityLiving.v(EntityLiving.java:711)
        at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
        at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
        at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
        at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
        at net.minecraft.server.World.cleanUp(World.java:1104)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-08-03 11:58:50 [SEVERE] Exception in thread "Thread-140299"
    2011-08-03 11:58:50 [SEVERE] java.lang.NullPointerException
    2011-08-03 11:58:50 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftEntity.getNearbyEntities(CraftEntity.java:149)
    2011-08-03 11:58:50 [SEVERE]     at me.everdras.blackPlague.PlagueThread.run(PlagueThread.java:68)
    I put in a hotfix for it into my code, but after looking at the stack trace again it appears it won't help at all since the error isn't in my code at all...

    Anyone know what to make of this?
     
  2. Offline

    nisovin

    Are you trying to run non-safe API functions from your own thread?
     
  3. Offline

    Everdras

    Non-safe?
    Such as...?
    This is the Thread in question:
    http://code.google.com/p/bukkit-bla...src/me/everdras/blackPlague/PlagueThread.java

    Line 68 is the method that caused the exception.

    Also, this isn't a consistent bug. I've been unable to reproduce it on my own and no-one else has reported anything like it. It's just on this one server, and they say it happens whenever they have it installed. I.e. they can reproduce it.

    EDIT: As I'm looking over the code, I'm guessing getNearbyEntities() isn't safe to be run in its own thread. The same person just posted a different stack trace with a ConcurrentModificationException, which can only be from something else since in my code I have the intrinsic lock of all the variables I'm using.
     
  4. Offline

    nisovin

    Why don't you use the BukkitScheduler? That's what it's there for...
     
  5. Offline

    Everdras

    Never heard of it, I'll look at it.
     
  6. Offline

    OblivionFan

    I'm no expert,but i think that even though your plugin is working,it does something that crashes bukkit...still your fault! :D

    LE: Just took a quick look at the plugin..NICE! The plague....sounds cool,and it's pretty original!
     
  7. Offline

    Tster

    Basically the format is:
    get the server some how and define it as server
    server.getScheduler.ScheduleSyncDelayedTask(plugin, new Runnable(){
    public void run(){
    insert code
    }
    }, INSERTDELAYHEREINTICKS)
     
  8. Offline

    Everdras

    Ah thanks. =)
     
  9. hi, did you solve this ?
     
  10. Offline

    Everdras

    I did solve this. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page