Results 1 to 3 of 3

Thread: Proxy bean issue

  1. #1
    Join Date
    Jan 2008
    Posts
    9

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    You are using class proxies, you don't programm to interfaces is my guess. Enable classproxying.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jan 2008
    Posts
    9

    Default 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •