This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This only happens when I attempt to run my JUnittest in the debugger. It does not happen when I run my JUnit test without debugger nor does it happen in a production run of my greater product.
org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array.
As the first line of my test (not in setUp(), but in the first line of "real" code), I have:
GQUser is a class in another of the five smallish projects that make up my application. In the project of which my JUnit test is a part of, I get it via a JAR. Once I step past that statement, however, and I click on smacko in the (debugger) Variables pane to see its value, the value appears as (the exception) noted above.
This happens regardless of whether I put this code in my test method or in setUp().
I've Googled this and found 9 results--several people have seen this, some in exactly my same circumstances. Only 2 of them are interesting in that they have answers and neither shows any real explanation or an encouraging solution. One answer is by someone who completely gives up. The other one waffles. I've also asked around a bit here, but none of my acquaintances have ever seen it.
This mess absolutely destroys any chance I have of being able to step through my application as this class is used all over. While this situation is created to simplify what's happening (which it does very nicely), I have a class, ProgGlobals, that must instantiate several pieces of static final data of this class in order to function. I am unable to see a way to program around it.
Thanks for reading this and for any comments made.
Having read the JavaDoc for the exception, this sounds like an Eclipse bug to me. You might want to file it to the Eclipse bug database.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Feb 26, 2008
Thanks, I couldn't decide which forum of two and that was the other forum. When I submitted this, I was still thinking that it might be something I don't know about JARs. Later, after working some more with it, I decided I had made a mistake submitting to JavaRanch and then submitted it to an Eclipse forum.
To update this issue, I have discovered that the class is indeed loaded and functioning. It's just the Eclipse debugger that does not somehow have access to it. What's going on underneath, however, is fine and working as expected: I just can't look directly at it in the debugger. A print statement in the code, even when running the debugger, demonstrates that all is well. Go figure.
Joined: Jul 11, 2001
Yes. The problem is that the Eclipse debugger is trying to fetch information for a class that the application hasn't loaded yet. Or so it seems.
Joined: Feb 26, 2008
And, once it has determined that the class hasn't been loaded (maybe it has, maybe it hasn't), it persists in that observation thereafter. No instance of GQUser ever shows anything else.