Java Error: EventDispatchThread.run() line: not available [local variables unavailable]
Asked Answered
I

3

6

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?

Ias answered 22/2, 2011 at 16:28 Comment(0)
P
6

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

Here are the settings you have to change:

debugger settings

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 ...

Priester answered 22/2, 2011 at 16:34 Comment(7)
Thank you for your answer but I checked my settings and I have the same as you wrote. Also in the Run Config I see all source folders.Ias
I added additional infos to the post in focus to the workspace setup. Maybe you notice something strange here.Ias
@Ias in the Source tab, have you tried checking the Check for duplicate source files on the path option?Priester
@Ias also, have you checked the build path and verified that one project actually references the other (and not perhaps a jar from a local repository)?Priester
I now tried the check and it wasn't working. To the build path: In both projects I see all .class files I need. In the main project's settings I have under "Properties" > "Java Build Path" > "Projects" the supporting project included. I normally use this to get an other project included in the main startup project.Ias
@Ias sorry, sounds like I'd need access to your machine to help :-)Priester
:-( I can't do that. No more ideas where to look at?Ias
S
0

EventDispatchThread.run() line: not available. This is a common error message for java desktop application developer, who are mainly working in Swing. I also got the same error message but the step you explained doesn't solve my prob.I got the same error message for another issue.That was OutOfMemoryError.So when you are getting this error message the problem you need to find yourself and it's not due to some particular issue.

Suffruticose answered 15/9, 2014 at 17:51 Comment(0)
M
0

I resolved this by fixing my Java Swing Code which was throwing NullPointerException.

Maureen answered 17/2, 2015 at 22:7 Comment(1)
Can you be more specific on how you fixed your code, and why this solves the problem?Engenia

© 2022 - 2024 — McMap. All rights reserved.