• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 537
  • Last Modified:

Spring Error with annotated methods

Hi,
I am working on simple spring example. I am getting error as in screenshot for method implementations like popQuestion() within  SpringQuizMaster class eventhough it is implementing QuizMaster interface defined wih popQuestion() method empty declaration. How can i resolve this issue. Any ideas, suggestions, sample code, resources highly appreciated. Thanks in advance.
SpringError.JPG
0
gudii9
Asked:
gudii9
  • 5
  • 5
  • 2
  • +1
3 Solutions
 
Ajay-SinghCommented:
>> it is implementing QuizMaster interface defined wih popQuestion() method empty declaration.

Interface can't have any declaration of method. Are you sure that QuizMaster is interface? and it has method "public
String popQuestion();"?
0
 
Sathish David Kumar NArchitectCommented:
u must implement the package of the  QuizMaster Interface ...

In ur scrren shot i didnt find the package name ???????

0
 
Sathish David Kumar NArchitectCommented:
package (urQuizMaster package Name)
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
gudii9Author Commented:
hi,

The interface has public QuizMaster() method within the same package. Please advise
spring-interface.JPG
0
 
Sathish David Kumar NArchitectCommented:
package com.vaannila; // ur not this in ur page !!  check that !!!


public class SpringQuizMaster implements QuizMaster {

@Override

public String popQuestion() {

return "Are you new to Spring?";

}

}
0
 
Ajay-SinghCommented:
Looks like the JDK is pointing to version 5 or below, as @Override annotation for interfaces can only be added to JDK 6
0
 
gudii9Author Commented:
Hi,
I took care of all the package names, structure etc. I changed the JDK to 1.6 instead of 1.5 as in screenshot withing RAD 7.0 IDE. i still see the @ override annotation error. How can i resolve it. Please advise .
JDKSpring.JPG
0
 
gudii9Author Commented:
Hi,

Please find the link of example i am doing

http://www.vaannila.com/spring/spring-ioc-1.html
0
 
Sathish David Kumar NArchitectCommented:
Do one thing remove that anotation @override in ur code check whether u get same error or not ?

0
 
pallab_lahiriCommented:
I think I faced this problem in the past.
Make sure that your IDE projects are setup to use a Java 6 JRE, and that the "source compatibility" is set to 1.6 or greater.

http://stackoverflow.com/questions/987973/eclipse-complaining-about-override

if it doesn't solve the problem do this:
in the preference window Java > Compiler > Errors / Warnings >  Annotations > Missing '@Override' annotation
disable this option.

check these link for details
http://stackoverflow.com/questions/224945/add-warning-for-missing-override-annotation-for-interface-implementation-in-ecli

0
 
gudii9Author Commented:
Hi,

>>>>Make sure that your IDE projects are setup to use a Java 6 JRE, and that the "source compatibility" is set to 1.6 or greater.

How to do that within RAD 7.0?

When i right click on the project and say propertis...i see one option to  change compiler from 5.0 to 6.0 as in screenshot. But i do not see option to change JRE there though. Please advise
compiler.JPG
0
 
pallab_lahiriCommented:
May be this is an RAD issue. I am no aware how to disable the @override option in RAD.  
Can you check what compilation error are you getting, is there any hint solition given by the IDE (Click on the red button to check it)

You can try removing the Override option I hope it will compile.
0
 
Sathish David Kumar NArchitectCommented:
0
 
gudii9Author Commented:
thank you very much. I appreciate it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now