Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JDT debugger: please explain "exclude exception location"
JDT debugger: please explain "exclude exception location" [message #122633] Wed, 26 November 2003 20:33 Go to next message
Eclipse UserFriend
I am experimenting with some sample code that uses a third-party library.
When running this code in the debugger, it unexpectedly stops in the method
java.net.URLClassLoader.findClass, on the line that throws
ClassNotFoundException(name) . I'm using Eclipse 2.1.0 and JDK 1.4.1_02.

1. I don't understand why Eclipse is stopping there. I don't have any
breakpoints set and this exception is caught successfully if I do a "resume"
to continue execution.
2. If I right-click on the stack frame at the location where Eclipse has
stopped, there's a menu item that says "exclude exception location". If I
click on this menu item, then Eclipse no longer stops at this location.
That's great since I'm not really interested in this exception. But where is
the list of excluded exception locations kept? I can't find it in the
Eclipse UI but I assume it's hiding somewhere so that you can un-exclude an
exception location. I'd like to be able to get back to a clean initial state
if I want to.

Can anyone explain how this "exclude exception location" feature works? I
can't find any info on it in the Eclipse doc or by searching the web.

For context, I should mention that the class being loaded may be largely
implemented in native code via JNI. Not sure if this is relevant or not to
the question of why the debugger is stopping.

-Walter Gillett

Here's the method on URLClassLoader mentioned above:

protected Class findClass(final String name)
throws ClassNotFoundException
{
try {
return (Class)
AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws ClassNotFoundException {
String path = name.replace('.', '/').concat(".class");
Resource res = ucp.getResource(path, false);
if (res != null) {
try {
return defineClass(name, res);
} catch (IOException e) {
throw new ClassNotFoundException(name, e);
}
} else {
throw new ClassNotFoundException(name);
}
}
}, acc);
} catch (java.security.PrivilegedActionException pae) {
throw (ClassNotFoundException) pae.getException();
}
}
Re: JDT debugger: please explain "exclude exception location" [message #122774 is a reply to message #122633] Thu, 27 November 2003 14:39 Go to previous message
Eclipse UserFriend
You likely have the preference to "suspend on uncaught exceptions" on, and
this is why your program is stopping (it's on by default). See the Java ->
Debug preference page for this.

You have found a slight bug with the "exclude exception location" action.
Exception breakpoints can be configured to exclude/inlcude certain locations
(via the breakpoint "Properties..." action). In this case, we add the
exclusion to a special "hidden" breakpoint which suspends on uncaught
exceptions. This is unintentional (and I will file a bug).

Darin


"Walter Gillett" <walter_gillett@hotmail.com> wrote in message
news:bq3k4q$pts$1@eclipse.org...
> I am experimenting with some sample code that uses a third-party library.
> When running this code in the debugger, it unexpectedly stops in the
method
> java.net.URLClassLoader.findClass, on the line that throws
> ClassNotFoundException(name) . I'm using Eclipse 2.1.0 and JDK 1.4.1_02.
>
> 1. I don't understand why Eclipse is stopping there. I don't have any
> breakpoints set and this exception is caught successfully if I do a
"resume"
> to continue execution.
> 2. If I right-click on the stack frame at the location where Eclipse has
> stopped, there's a menu item that says "exclude exception location". If I
> click on this menu item, then Eclipse no longer stops at this location.
> That's great since I'm not really interested in this exception. But where
is
> the list of excluded exception locations kept? I can't find it in the
> Eclipse UI but I assume it's hiding somewhere so that you can un-exclude
an
> exception location. I'd like to be able to get back to a clean initial
state
> if I want to.
>
> Can anyone explain how this "exclude exception location" feature works? I
> can't find any info on it in the Eclipse doc or by searching the web.
>
> For context, I should mention that the class being loaded may be largely
> implemented in native code via JNI. Not sure if this is relevant or not to
> the question of why the debugger is stopping.
>
> -Walter Gillett
>
> Here's the method on URLClassLoader mentioned above:
>
> protected Class findClass(final String name)
> throws ClassNotFoundException
> {
> try {
> return (Class)
> AccessController.doPrivileged(new PrivilegedExceptionAction() {
> public Object run() throws ClassNotFoundException {
> String path = name.replace('.', '/').concat(".class");
> Resource res = ucp.getResource(path, false);
> if (res != null) {
> try {
> return defineClass(name, res);
> } catch (IOException e) {
> throw new ClassNotFoundException(name, e);
> }
> } else {
> throw new ClassNotFoundException(name);
> }
> }
> }, acc);
> } catch (java.security.PrivilegedActionException pae) {
> throw (ClassNotFoundException) pae.getException();
> }
> }
>
>
Previous Topic:[ANN] M5 Support for SWT Designer & CodePro Available
Next Topic:packaging jars (un?required ant jars)
Goto Forum:
  


Current Time: Sun Jul 27 13:42:53 EDT 2025

Powered by FUDForum. Page generated in 0.03432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top