• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

ClassNotLoadedException in Eclipse debugger

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This only happens when I attempt to run my JUnit test 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.

Russ Bateman
 
author & internet detective
Posts: 41656
883
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Russ,
This questions sounds IDE related. I'm going to move it to our IDEs forum in case someone more expert in Eclipse knows.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Russell Bateman
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Russell Bateman
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have the same problem with eclipse J2EE Version: 3.4.0. Have you solved it with a newer eclipse version?

Regards,
Franz
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem still exists in 3.4.2.

G
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any solution arrived at this? Am facing the same problem.
 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Carry out the following checks.

1)What is your JAVA_HOME version in your command prompt type echo %path%

2)In your eclipse IDE go to Windows Preferences, select java then complier that is where your JDK is, make sure its the same as your java home

3) At bottom of the preferences window if you are not using a compatiable jre it will prompt you, make sure its using the same version as your JDK in my case 1.6
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic