File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem compiling my listener class" Watch "problem compiling my listener class" New topic
Author

problem compiling my listener class

Emmanuel Okandeji
Greenhorn

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
Greenhorn

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

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
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: problem compiling my listener class
 
Similar Threads
Cannot find symbol :Class Dog
javac compiling problem
Package Problem
Problems with Tomcat
unable to compile servletListener