Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

Servlet API:  decprecated Exception..

Thread view: 
Frances Del Rio - 28 Mar 2005 20:51 GMT
this line is not being accpeted on compiling:

throw new UnavailableException(this, "chatprops not set in servlet init
parameters");

it says that "UnavailableException" has been deprecated..  usu. I look
up the deprecated stuff in API and it often says what it's been replaced
with...   but in this case it says it has "no replacement"...  so: I
tried using "ServletException" but it still won't compile..  also tried
just "Exception" but no go either.. (shouldn't "Exception" work?  since
it's part of java.lang package?)

(also why has this been "deprecated" when in fact I'm using same version
of Tomcat that I first downloaded a last summer (5.0.27)?  or does
Tomcat ship with deprecated stuff?  I mean b/c Servlet API that shipped
w/Tomcat DOES list UnavailableException...
pls explain..  thank you.. Frances
Ryan Stewart - 28 Mar 2005 23:40 GMT
> this line is not being accpeted on compiling:
>
[quoted text clipped - 13 lines]
> UnavailableException...
> pls explain..  thank you.. Frances

A "deprecated" message is (normally) a warning, not an error, meaning that the
source was compiled and you can run it. Further, UnavailableException is not
deprecated, but some of its constructors/methods are: specifically, the ones
that deal with a servlet reference.
Juha Laiho - 30 Mar 2005 19:59 GMT
Frances Del Rio <fdr58@yahoo.com> said:
>throw new UnavailableException(this, "chatprops not set in servlet init
>parameters");
>
>it says that "UnavailableException" has been deprecated..  usu. I look
>up the deprecated stuff in API and it often says what it's been replaced
>with...   but in this case it says it has "no replacement"...

Hmm? Where exactly do you find the statement of any constructor of
UnavailableException being deprecated with no replacement?
Looking at the servler API javadocs at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/index.html
I find that two constructors of UnavailableException have been
deprecated, but replacements have been specified for both.

>so: I tried using "ServletException" but it still won't compile.. also
>tried just "Exception" but no go either.. (shouldn't "Exception" work?
>since it's part of java.lang package?)

Hmm.. you didn't tell which class/method it was where you were
trying to create (and throw) this exception. For example, if it
was an init() method within a class implementing Servlet,
throwing ServletException (or any subclass of it - including
UnavailableException) is ok, but throwing plain Exception is
not (because Servlet.init() is only declared to throw
ServletExceptions (and subclasses of ServletException).

>(also why has this been "deprecated" when in fact I'm using same version
>of Tomcat that I first downloaded a last summer (5.0.27)?  or does
>Tomcat ship with deprecated stuff?  I mean b/c Servlet API that shipped
>w/Tomcat DOES list UnavailableException...
>pls explain..  thank you.. Frances

The two constructors of UnavailableException are deprecated as of
Servlet API version 2.2, which was published in late 1999, so
they have been deprecated for quite a long time.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.