Java错误:EventDispatchThread.run()行:不可用[局部变量不可用] [英] Java Error: EventDispatchThread.run() line: not available [local variables unavailable]

查看:2186
本文介绍了Java错误:EventDispatchThread.run()行:不可用[局部变量不可用]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  EventDispatchThread.run()行:我在尝试在调试器中启动代码时收到以下错误消息:不可用[本地变量不可用] 

代码非常大,我不能在这里发布无论如何,这里有一些细节:



这个语句似乎崩溃了,我无法进入调试器的构造函数:

 卫星卫星=新卫星(); 

当我在此行上放置一个断点,并尝试进入构造函数或步骤,我得到



以下是Satellite类实现的一部分:

 包标签; 

import main。*;
import xml。*;

public class Satellite extends XMLElement {

public static final String [] ATTRIBUTES = {
XmlFileVersion,
SatelliteName,
xmlns:xsi = @ xmlns_xsi,
xsi:noNamespaceSchemaLocation = @ xsi_noNamespaceSchemaLocation
};

public Satellite(){
super(ATTRIBUTES);
setTopLevelElement();

setAttribute(XmlFileVersion,ValueCenter.Satellite_XmlFileVersion());
setAttribute(SatelliteName,ValueCenter.Satellite_SatelliteName());
addElement(new SubSystemList());
}
}

我将问题本地化在行中的某个位置 addElement(new SubSystemList()); 我在这里添加了一个断点,试图进入或者逐步,现在我得到一个 ClassNotFoundException 。调试光标跳到一个空的窗口,其中找不到源。是写的,但是源是100%可用,我也得到了相应的.class文件。另一件事是,Eclipse IDE在语法检查中不会出现任何错误。



我不明白这一点。什么可能导致这些错误,为什么我不能使用调试器来遍历方法调用?



我已经更新了Eclipse Helios SR1 for Java Devs并安装了我的电脑上最新的java版本。



我知道代码在这里有一个无休止的循环,因为我得到一个 StackOverflowError 如果我运行它没有调试器。但无论如何,是不是可以通过代码调试,调查真正的问题?为什么调试器与非调试器运行的其他错误或异常崩溃?



btw:只有一个线程和顺序执行。



希望有人可以帮助。



编辑1:



其他一些信息。我的工作区有两个项目。其中有卫星和其他的主要方案。在另一个项目中,我有很多支持类,如XMLElement。这个结构适用于许多类。



顺便说一下:我可以进入XMLElement.setAttribute方法,但是我无法进入XMLElement.addElement。另一个奇怪的是,卫星与主类在同一个项目中,但也不可能进入构造函数。



也许这有帮助?

解决方案

在Eclipse中:右键单击该项目,然后选择属性



以下是您必须更改的设置:





另外,使用运行>运行配置... ,选择选项卡,并确保当前项目位于源列表中。如果没有,请点击添加...> Java Project ...


I get the following error when I try to start my code in the debugger.

EventDispatchThread.run() line: not available [local variables unavailable]

The code is very large and I can't publish it here but anyway here are some details:

This statement seems to crash and I can't step into the constructor with the debugger:

Satellite satellite = new Satellite();

When I put a breakpoint on this line and try to step into the constructor or step over I get the same error as above.

Here are parts of Satellite class implementation:

package tags;

import main.*;
import xml.*;

public class Satellite extends XMLElement {

    public static final String[] ATTRIBUTES = {
        "XmlFileVersion",
        "SatelliteName",
        "xmlns:xsi=@xmlns_xsi",
        "xsi:noNamespaceSchemaLocation=@xsi_noNamespaceSchemaLocation"
    };

    public Satellite() {
        super(ATTRIBUTES);
        setTopLevelElement();

        setAttribute("XmlFileVersion",ValueCenter.Satellite_XmlFileVersion());
        setAttribute("SatelliteName",ValueCenter.Satellite_SatelliteName());
        addElement(new SubSystemList());
    }
}

I localized the problem somewhere in the line addElement(new SubSystemList()); . I added a breakpoint here and again tried to step in or step over and now I got a ClassNotFoundException. The debug cursor jumps to an empty window where "Source not found." is written but the Source is 100% available and I also got the corresponding .class files. The other thing is that the Eclipse IDE throws no errors on the syntax check.

I don't understand this. What can cause these errors and why can't I use the debugger to walk through the method calls?

I've updated the Eclipse Helios SR1 for Java Devs and installed the latest java version on my pc.

I know that the code has an endless loop anywhere in here because I get an StackOverflowError Exception if I run it without the debugger. But anyway, shouldn't it be possible to debug through the code, to investigate the real problem? Why is the debugger crashing with other errors or exceptions than a non debugger run?

btw: only one thread and sequential execution.

Hope someone can help.

Edit 1:

Some additional infos. My Workspace has two projects. In one there is the main program with the Satellite and others. In the other project I have many supporting classes like this XMLElement. This structure works for many classes.

By the way: I can step into the XMLElement.setAttribute method but I can't step into the XMLElement.addElement.

The other strange thing is that Satellite is in the same project as the main class but it's also not possible to step into the constructor.

Maybe this helps?

解决方案

In Eclipse: Right-click the project and select Properties.

Here are the settings you have to change:

Also, find your Run Configuration using Run > Run Configurations ..., select the Source tab and make sure the current project is in the sources list. If not, click Add... > Java Project ...

这篇关于Java错误:EventDispatchThread.run()行:不可用[局部变量不可用]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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