?
Solved

Spring Error with annotated methods

Posted on 2009-12-25
14
Medium Priority
?
528 Views
Last Modified: 2013-11-23
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
Comment
Question by:gudii9
  • 5
  • 5
  • 2
  • +1
14 Comments
 
LVL 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 400 total points
ID: 26123663
>> 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
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 26123785
u must implement the package of the  QuizMaster Interface ...

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

0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 26123787
package (urQuizMaster package Name)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Author Comment

by:gudii9
ID: 26125274
hi,

The interface has public QuizMaster() method within the same package. Please advise
spring-interface.JPG
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 26126440
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
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 26126546
Looks like the JDK is pointing to version 5 or below, as @Override annotation for interfaces can only be added to JDK 6
0
 
LVL 7

Author Comment

by:gudii9
ID: 26128536
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
 
LVL 7

Author Comment

by:gudii9
ID: 26128549
Hi,

Please find the link of example i am doing

http://www.vaannila.com/spring/spring-ioc-1.html
0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 1200 total points
ID: 26130621
Do one thing remove that anotation @override in ur code check whether u get same error or not ?

0
 
LVL 1

Assisted Solution

by:pallab_lahiri
pallab_lahiri earned 400 total points
ID: 26143306
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
 
LVL 7

Author Comment

by:gudii9
ID: 26171834
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
 
LVL 1

Expert Comment

by:pallab_lahiri
ID: 26187681
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
 
LVL 7

Author Closing Comment

by:gudii9
ID: 31669988
thank you very much. I appreciate it.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question