Announcement Announcement Module
Collapse
No announcement yet.
Proxy bean issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Proxy bean issue

    I've searched the forum for a solution to this but found nothing... Maybe someone else can shed some light on this.

    I am using an annotated Aspect class with a simple @Before that outputs to the console. When I start up my application in tomcat I get the following exception:

    BeanNotOfRequiredTypeException: Bean named 'foo.bar.Bar' must be of type foo.bar.Bar but was actually of type [$Proxy9].

    In a forum post it sounds like something to do with class loaders?? Any thoughts?

  • #2
    You are using class proxies, you don't programm to interfaces is my guess. Enable classproxying.

    Comment


    • #3
      Proxy Bean issue

      I am actually implementing an interface that has two methods.

      @Before("execution(* com.foo.bar.Bar.isRunning()")

      isRunning is a method on the interface that is implemented by the Bar class.

      I have tried both proxy-target-class="false" and proxy-target-class="true" But get the same message.

      Comment

      Working...
      X