0

I have implemented the method as below but there is an error saying - remove override annotation, which should be there. Under which circumstances this error would occur? Due to this my beans are not being created and I am not able to run the application.

@Override
 public void setServletContext(ServletContext servletContext) {
}

The error which shows up on the console is - "The method setServletContext(ServletContext) of type MenuHelper must override a superclass method". But the method is there and goes undetected. If I remove the method, there should be an error saying add the unimplemented methods - which is also not showing up. Kindly help me with this situation. Thanks

Nihal Sharma
  • 2,397
  • 11
  • 41
  • 57
  • read [this](http://stackoverflow.com/questions/212614/should-a-method-that-implements-an-interface-method-be-annotated-with-override) – TheWhiteRabbit Feb 01 '13 at 06:00
  • and [this](http://stackoverflow.com/questions/212614/should-a-method-that-implements-an-interface-method-be-annotated-with-override#comment92398_212624) comment – TheWhiteRabbit Feb 01 '13 at 06:00
  • Check the target compiler version. Please use a compiler for at least Java 6 or 7 runtime – Boris Treukhov Feb 01 '13 at 06:01
  • possible duplicate of [Why is javac failing on @Override annotation](http://stackoverflow.com/questions/2335655/why-is-javac-failing-on-override-annotation) – Boris Treukhov Feb 01 '13 at 06:08
  • I have one more thing to add - I can build through ant and run tomcat separately and access the application's url. But the eclipse has some error. I have changed the build to Java 1.6 and jre6 is also there. Now where is the issue? – Nihal Sharma Feb 01 '13 at 06:12

1 Answers1

0

I can't be sure without seeing the rest of your code, but from that error I'm guessing that your class does not implement ServletContextAware properly.

Aurand
  • 5,487
  • 1
  • 25
  • 35