aspose file tools*
The moose likes Spring and the fly likes method injection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "method injection problem" Watch "method injection problem" New topic
Author

method injection problem

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
this is my main class


this is my xml file


it gives this error


but if i remove this part from xml it is working without errors
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Make sure that CGLib is in your CLASSPATH.


[My Blog]
All roads lead to JavaRanch
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I added cglib.jar to classpath .still same error.

anyway i post all classes here

Animal interface


Dog class


Chicken class


ArtificialChicken class


main class


xml file


Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
the error says
Invalid method override: no method with name 'getMeat' on class

It is no need to overide a get Meat in Chicken class.
why it gives that error?
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I change the xml file as below


now it gives another error

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer

Is the cglib jar still in your classpath?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I added cglib-2.2.jar using eclips.

I click project and click Build ->Configure Build Path
then add cglib-2.2.jar jar file.
is it ok?
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

HI Samanthi ,

Infact all your code works pretty good



I added "com.springsource.net.sf.cglib-2.1.3.jar" to classpath ...


Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I also have added that jar file.But still givews this rerror

Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225


after adding the required jar for eclipse , right click and refresh ...

CTRL+SHIFT+T --> Opens Class Browser in eclipse , where you type "Enhancer" , it should display
the jar which you had attached ...

if you didnt see jar attached , then jar is not properly set .. alternately you can check .classpath file of the project also ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method injection problem