我有一个非常烦人的问题,当在 eclipse 中从我的源代码中导出一个 jar 文件时,我不会在堆栈跟踪中获得有关发生错误的源代码和行号的信息。我已经检查了项目的 ecplise 中的编译器设置,并设置了部分类文件生成中的所有选项。我正在开发由服务器软件 bukkit 执行的 Minecraft 插件。我的来源在 de.celestialcraft.agentestate 包中。发生异常时,我得到这样的堆栈跟踪:
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
我已将构建路径设置中的 jdk 路径设置为项目的 lib。我希望你能帮助我解决这个问题。谢谢你。