Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring AOP Help

 
Phoenix Kilimba
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sirs et Madames,
I am experiencing a few issues in regards to using Spring AOP.

Currently the application runs with no exceptions , but in order to achieve what I need to achieve, I have to define an aspect in my applicationContext.xml file. However, as soon as I introduce the following element:



I get the following error stack trace:



Has anyone any idea why this may happen? The only change I have made so far is added those 2 lines
<aop:config>
</aop:config>

I have also imported the relevant namespaces for AOP ( I think ) like so:


can anyone please advise?
Thanks in advance.


 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The base exception is here -


# 2010-05-04 18:32:48.138::WARN: Nested in org.springframework.beans.factory.BeanCreationException:
# Error creating bean with name 'org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0':
# Initialization of bean failed; nested exception is java.lang.ClassCastException:
# org.springframework.transaction.annotation.AnnotationTransactionAttributeSource cannot be cast to
# org.openhds.dao.finder.FinderExecutor: java.lang.ClassCastException:
# org.springframework.transaction.annotation.AnnotationTransactionAttributeSource cannot be cast to
# org.openhds.dao.finder.FinderExecutor
# at org.openhds.dao.finder.Interceptor.invoke(Interceptor.java:19)


What's at org.openhds.dao.finder.Interceptor.invoke(Interceptor.java:19)?

What does the org.openhds.dao.finder.FinderExecutor class have in it?
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you use @Aspect annotation? if you use aspect annotation you don't need to introduce the <aop/> tag in your configuration file.
 
Phoenix Kilimba
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nathan Pruett wrote:The base exception is here -


# 2010-05-04 18:32:48.138::WARN: Nested in org.springframework.beans.factory.BeanCreationException:
# Error creating bean with name 'org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0':
# Initialization of bean failed; nested exception is java.lang.ClassCastException:
# org.springframework.transaction.annotation.AnnotationTransactionAttributeSource cannot be cast to
# org.openhds.dao.finder.FinderExecutor: java.lang.ClassCastException:
# org.springframework.transaction.annotation.AnnotationTransactionAttributeSource cannot be cast to
# org.openhds.dao.finder.FinderExecutor
# at org.openhds.dao.finder.Interceptor.invoke(Interceptor.java:19)


What's at org.openhds.dao.finder.Interceptor.invoke(Interceptor.java:19)?

What does the org.openhds.dao.finder.FinderExecutor class have in it?


Well the Interceptor class is like so:



And the FinderExecutor is like:



Hope this helps. Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic