• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

problem compiling my listener class

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You Very, Very much.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"key pad", please check your private messages for an important administrative matter.
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic