StackTrace Java Eclipse中的未知来源 [英] Unknown Source in Stacktrace Java Eclipse

查看:188
本文介绍了StackTrace Java Eclipse中的未知来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常令人讨厌的问题,当我从eclipse中的源代码导出jar文件时,我将不会在堆栈跟踪中找到有关发生错误的源和行号的信息。我已经检查了ecplise中的编译器设置项目,并且设置了类文件生成部分中的所有选项。
我正在开发由服务器软件bukkit执行的Minecraft的插件。我的资料来源于de.celestialcraft.agentestate。发生异常我得到这样的堆栈跟踪:

  23:43:57 [INFO] com.sk89q.worldedit.CuboidClipboard @ fb44f99 
23:43:57 [SEVERE]无法将事件BlockDamageEvent传递给AgentEstate v2.1alpha

org.bukkit.event.EventException
在org.bukkit.plugin。 java.JavaPluginLoader $ 1.execute(JavaPluginLoader.ja
va:363)
在org.bukkit.plugin.RegisteredListener.callEvent(registeredListener.jav
a:62)
在org。 bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
在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.reflec t.Method.invoke(Unknown Source)
在org.bukkit.plugin.java.JavaPluginLoader $ 1.execute(JavaPluginLoader.ja
va:361)
在org.bukkit.plugin.RegisteredListener .callEvent(RegisteredListener.jav
a:62)
在org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
在org.bukkit.plugin。 SimplePluginManager.callEvent(SimplePluginManager.j
ava:462)
在ir.b(ItemInWorldManager.java:393)
在ir.a(ItemInWorldManager.java:200)
在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)
在ho.r(DedicatedServer.java:309)
在net.minecraft.server.MinecraftServer.q(MinecraftServer.java:857)
在net.minecraft .S erver.MinecraftServer.run(MinecraftServer.java:744)
在fy.run(ThreadMinecraftServer.java:16)
导致:java.lang.NullPointerException
在com.sk89q.worldedit。原理图MCEditSchematicFormat.save(未知Sour
ce)
在de.celestialcraft.AgentEstate.Estate.saveState(未知来源)
在de.celestialcraft.AgentEstate.Estate.create(未知来源)
在de.celestialcraft.AgentEstate.Estate.create(未知来源)
在de.celestialcraft.AgentEstate.AgentEstateBlockListener.onBlockDamage(
未知来源)
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(未知来源)
在org.bukkit.plugin.java.JavaPluginLoader $ 1.execute(JavaPluginLoader.ja
va:361)
... 25更多

我有并将构建路径设置中的jdk路径作为项目的lib。希望你能帮我解决这个问题。
谢谢。

解决方案

由于Bukkit是一个API,当您编写一个bukkit插件时,您正在创建代码块只有Bukkit知道如何处理所述代码。为了找出你在这里发布的错误是什么,你需要查看顶部的行,如果StackTrace中的at行,并在Github的Bukkit源文件中找到它。例如,在这个堆栈跟踪中,你有这个顶部:

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

你可以看到有一个Bukkit EventException是由第三百三十三行的JavaPluginLoader中的一个错误引起的。为了找出确切的内容,你应该访问 https://github.com/Bukkit/Bukkit/releases ,并下载您正在编码的MC版本的相应源版本。在这个zip文件中,您将在src / main / java /找到源文件夹,并按照这个stacktrace(org / bukkit / plugin / java / JavaPluginLoader)的第2行的路径,并在该文件的第363行中看到错误发生。



由于我不知道你正在编码的Bukkit版本,我不能帮助你过去这里,除非说那个文件中的哪个方法有363行作为它的一部分是与你的问题有关。如果您弄清楚该方法的作用,那么Bukkit会尝试使用您的插件代码并失败。


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.

解决方案

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.

这篇关于StackTrace Java Eclipse中的未知来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆