jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes problem compiling my listener class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem compiling my listener class" Watch "problem compiling my listener class" New topic

problem compiling my listener class

Emmanuel Okandeji

Joined: Jun 12, 2008
Posts: 8
Please am having problem compiling Listener class... whenever i try to compile the code it gives me this Error.

Unreachable statement
ServletContext sc = event.getServletContext();

Here is my code....

Please can someone help me...... Thanks

Emmanuel.T.Okandeji<br />SCJP5
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
throw new UnsupportedOperationException("Not supported yet.");
As soon as above statement executes, the control never returns to this method again, that is why you are getting statement unreachable execption.
[ July 18, 2008: Message edited by: Piyush Mangal ]
Emmanuel Okandeji

Joined: Jun 12, 2008
Posts: 8
Thank You Very, Very much.
alex savu

Joined: Nov 13, 2008
Posts: 5
I had the same problem and I noticed that deleting the "throw UnsupportedException" instruction solves the problem. My question is why does the IDE (I am using NetBeans 6.01) keeps automatically inserting this throw instruction everytime I override a method from an interface? What's the use of this exception and what should I look out for when I erase the throw declaration? I could not find any obvious info about this on Google or the Java API, so please give me some pointers if you know anything about this subject. Thanks, all the best!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

"key pad", please check your private messages for an important administrative matter.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: problem compiling my listener class
It's not a secret anymore!