6

I have the very annoying problem, that when exporting a jar-file out of my source code in eclipse I will get no information in the stacktrace about the source and line number in which the error occurs. I have checked the compiler settings in ecplise for the project and all options in the section classfile generation are set. I'm developing plugins for Minecraft which are executed by the server software bukkit. My source is in the package de.celestialcraft.agentestate. On occurance of an exception I get such a stacktrace:

23:43:57 [INFO] com.sk89q.worldedit.CuboidClipboard@fb44f99
23:43:57 [SEVERE] Could not pass event BlockDamageEvent to AgentEstate v2.1alpha

org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:363)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62)
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:462)
    at de.celestialcraft.AgentEstate.AgentEstateBlockListener.onBlockBreak(U
nknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:361)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62)
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:462)
    at ir.b(ItemInWorldManager.java:393)
    at ir.a(ItemInWorldManager.java:200)
    at iv.a(NetServerHandler.java:782)
    at ei.a(Packet14BlockDig.java:67)
    at cg.b(TcpConnection.java:467)
    at iv.d(NetServerHandler.java:220)
    at iw.b(NetworkListenThread.java:57)
    at ht.b(DedicatedServerListenThread.java:34)
    at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:981)
    at ho.r(DedicatedServer.java:309)
    at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:857)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:744)
    at fy.run(ThreadMinecraftServer.java:16)
Caused by: java.lang.NullPointerException
    at com.sk89q.worldedit.schematic.MCEditSchematicFormat.save(Unknown Sour
ce)
    at de.celestialcraft.AgentEstate.Estate.saveState(Unknown Source)
    at de.celestialcraft.AgentEstate.Estate.create(Unknown Source)
    at de.celestialcraft.AgentEstate.Estate.create(Unknown Source)
    at de.celestialcraft.AgentEstate.AgentEstateBlockListener.onBlockDamage(
Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:361)
    ... 25 more

I have set the jdk path in the build path settings as the lib for the project. I hope you can help me with this issue. Thank you.

Nerade
  • 61
  • 1
  • 3
  • How are you exporting the jar? – DiogoSantana Apr 15 '13 at 00:29
  • Just using the inbuild feature of Eclipse (Right-clicking on the project name >> Export) – Nerade Apr 15 '13 at 01:18
  • OS and java version? Are you able to debug that code? – DiogoSantana Apr 15 '13 at 01:22
  • I have Windows 8 and Java 1.7. Since this code isn't standalone I have never tried to do this...so I can not say if it is possible to debug. – Nerade Apr 15 '13 at 01:52
  • This looks like some kind of Voodoo would help - try cleaning the work space (`ecplise -c`) - or creating a new workspace and importing the project into it - it has a good chance of solving the problem – RonK Apr 15 '13 at 07:15
  • I created a new workspace and got the same issue. Is it important to notice that both workspaces are on my DropBox folder? – Nerade Apr 15 '13 at 10:50
  • By the way, do you think it's a configuration issue or a bug of eclipse? – Nerade Apr 16 '13 at 16:02
  • About DropBox - it might, I had projects running on GoogleDrive which totally freaked Eclipse out. Assuming you did the configuration correctly as you said - it can be an eclipse bug. – RonK Apr 17 '13 at 10:59
  • I have setup my workspace to debug this file but I got an error that debug is impossible due to missing line number information. So what would be my next step? Bug report at eclipse? – Nerade Apr 17 '13 at 12:45

2 Answers2

1

Since Bukkit is an API, when you code a bukkit plugin you are creating blocks of code in such a way that only Bukkit knows what to do with said code. In order to find out what is causing the error you have posted here, you need to look at the top line if the "at" lines in the StackTrace and find it in the Bukkit source files on Github. For example, in this stacktrace you have this at the top:

org.bukkit.event.EventException
  at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:363)

You can see that there is a Bukkit EventException caused by an error in the JavaPluginLoader at line 363. In order to find out exactly what went on there, you should visit https://github.com/Bukkit/Bukkit/releases and download the appropriate source version for the MC version you are coding for. In this zip file you would find the source folder at src/main/java/ and follow the path in line 2 of this stacktrace (org/bukkit/plugin/java/JavaPluginLoader) and in line 363 of that file you will see where the error occurred.

Since I do not know what version of Bukkit you are coding for, I can't help you out past here except to say that whichever method in that file has line 363 as part of it is the one that relates to your problem. If you figure out what that method does, it is what Bukkit tried to do with your plugin code and failed.

Nathan Meyer
  • 409
  • 1
  • 6
  • 13
0

Your project should be marked to enable project specific settings and on Java Compiler -> Classfile generation, the option Add line number... should be unmarked.

DiogoSantana
  • 2,404
  • 2
  • 19
  • 24