• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Stuck on AOP with AspectJ/Java

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking forward to posting on the Big Moose Saloon, need help, probably something simple I'm missing...

I am working through Spring Into Action 3, on page 132 (4.5 of that unit) I'm working through an Aspect J example.

This is made up of 4 different file, CriticismEngine(Interface), CriticismEngineImpl(implmentation), JudgeAspect(AspectJ Aspect), Preformance(contains main method), and my Spring configuration, spring-idol.xml

here is the Error:

Now the four files:

CriticismEngine:


CriticismEngineImpl.java:



JudgeAspect.aj:


Preformance:

and now my Spring configuration XML:




So, basically, when the bean with ID eddie preforms (that part of program works fine, just does a println of property values listed, criticismEngine is supposed to write criticism after the "preformance".

Let me know if anything else is needed, thanks!

Thanks!
 
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
looks like the problem lies here:



This is saying that there is a property on CriticismEngineImpl, called criticisms and you want to set a List<String> on it. So it expects the following:



You could actually leave it as a String[] if you wanted to and it should still work. Spring will figure it out. The reason it was failing is the setter name needs to match the property in the XML (minus the 'set' prefix)
 
Mark Arsenault
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, I feel foolish for even asking a question with such a simple answer. The problem here was tunnel vision, the originally posted code was almost a direct copy from the book, this is the third error I have found in this book. I defined the property in the configuration file, obviously I need to inject those values, but for some reason I just didn't connect it.

Thank you very much,

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic