• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Injecting non-Spring beans & Spring AOP not work together?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

I'm a greenhorn in Spring, and reading the book of Spring in Action 2nd Edition now. I got following problem when following the examples in the book and attempting to mix injecting non-Spring beans with normal Spring AOP features. Related chapters in the book are 3.3 and 4.3.

Source codes & configurations are (some simple classes are omitted):

1. I defined Magician class as following. Please note in order o make injecting non-Spring beans work, the annotation is added:



2. The MagicBox implementation class is:



3. Audience class for the aspect is:



4. Configurations are:



5. Test codes are:



And I run the codes with following VM argument:



Before applying the aop, both harry & lisa work perfectly well. However, after I added aop configurations, I got following output:



As you can see, harry still works but error happens at



I also noticed that if I move the section starting with



to the position before the definition of harry, then even harry cannot work.

Could anybody enlighten me on this. Thank you!
 
Eric Xin Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Can anybody help me?

Although the codes looks a bit length but you can just copy and paste them to try

BTW, I'm using Spring framework 2.5.6, all jar files are from spring-framework-2.5.6.SEC01-with-dependencies.zip.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,
Were you able to solve this problem? Can you please share the solution
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Namkere,

This post is quite old and I doubt the original poster is following it anymore. Are you still using Spring 2.5 or are you using a more current version? Please post a more detailed description of your problem (what you are trying to do and what it happening) and we can try to help you with it.
 
Danger, 10,000 volts, very electic .... tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic