You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jon Wingfield <jo...@mkodo.com> on 2003/12/05 14:20:59 UTC
Re: Illegal Access Error [ URLConnection ]
Yep. An Error isn't an Exception; it's a Throwable.
Inheritance tree:
Throwable
|
--------------
| |
Error Exception
HTH,
Jon
Stuart Stephen wrote:
> I tried putting a try and catch block around it to catch a the generic
> Exception. Yet that didn't work.
>
> Something is still a-miss?
>
> -----Original Message-----
> From: SH Solutions [mailto:info@sh-solutions.de]
> Sent: 05 December 2003 11:37
> To: 'Tomcat Users List'
> Subject: AW: Illegal Access Error [ URLConnection ]
>
>
> Hi
>
>
>>When I do URLConnection.guessContentTypeFromName(filename) I get an
>
> IllegalAccessError thrown. Yet, I cannot catch this as the method only
> throws an IOException.
>
> I dont know where this comes from since I dont have any idea what this
> method is all about.
> But I can tell you how to catch the Exception.
>
> try {
> ..
> } catch ( IllegalAccessError iae ) {
> }
>
> As of you post I guess you thought that you couldn't catch a Exception that
> is not declared to be thrown by the method in question. But this is only
> half the truth. You can throw everything that inherits from Throwable.
> Descendents of Exception are such classes, but there are more.
>
> You can catch about everything if you use this;
>
> } catch ( Throwable t ) {
> t.printStackTrace(); // not required but a good start.
> ...
>
> Cu
> Steffen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Illegal Access Error [ URLConnection ]
Posted by Stuart Stephen <st...@talkics.com>.
Ahh, didn't think of that. That's the badger.
Good work!
Thanks.
-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
Sent: 05 December 2003 13:21
To: Tomcat Users List
Subject: Re: Illegal Access Error [ URLConnection ]
Yep. An Error isn't an Exception; it's a Throwable.
Inheritance tree:
Throwable
|
--------------
| |
Error Exception
HTH,
Jon
Stuart Stephen wrote:
> I tried putting a try and catch block around it to catch a the generic
> Exception. Yet that didn't work.
>
> Something is still a-miss?
>
> -----Original Message-----
> From: SH Solutions [mailto:info@sh-solutions.de]
> Sent: 05 December 2003 11:37
> To: 'Tomcat Users List'
> Subject: AW: Illegal Access Error [ URLConnection ]
>
>
> Hi
>
>
>>When I do URLConnection.guessContentTypeFromName(filename) I get an
>
> IllegalAccessError thrown. Yet, I cannot catch this as the method only
> throws an IOException.
>
> I dont know where this comes from since I dont have any idea what this
> method is all about.
> But I can tell you how to catch the Exception.
>
> try {
> ..
> } catch ( IllegalAccessError iae ) {
> }
>
> As of you post I guess you thought that you couldn't catch a Exception
that
> is not declared to be thrown by the method in question. But this is only
> half the truth. You can throw everything that inherits from Throwable.
> Descendents of Exception are such classes, but there are more.
>
> You can catch about everything if you use this;
>
> } catch ( Throwable t ) {
> t.printStackTrace(); // not required but a good start.
> ...
>
> Cu
> Steffen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org