Results 1 to 3 of 3

Thread: arg-names inside Weblogic container but not when testing locally

  1. #1

    Default arg-names inside Weblogic container but not when testing locally

    Using Spring 3.1.0.M1...

    Testing locally in Eclipse the following AOP setup works fine WITHOUT the arg-names parameter in the after-returning advice. But when I run the same configuration (i.e. configuration files and build path) within Weblogic (10.3) I get:
    AmbiguousBindingException: Binding of returning parameter 'element' is ambiguous, there are 2 candidates.

    Code:
    <aop:config>
      <aop:aspect ref="elementIntegration">
        <aop:pointcut id="readElementPointcut" expression="execution(com.klistret.cmdb.ci.pojo.Element com.klistret.cmdb.service.ElementService.get(Long)) and args(id)" />
         ....
    
        <aop:after-returning pointcut-ref="readElementPointcut" method="read" arg-names="id,element" returning="element" />
         ....
      </aop:aspect>
    </aop:config>
    Any suggestions as to how to debug? Or has anybody run into this problem?

  2. #2
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    Just so we're clear, you're saying that if you use the listed code, it works fine in both Eclipse and WebLogic, but if you instead remove the "arg-names" property, it works in Eclipse, but fails in WebLogic?

    If that's the case, I would guess that the classes deployed to WebLogic are not compiled with the debug flag.

  3. #3

    Default

    How did you know? ;-)

    Turns out the debug flag in my Ant build f-uped other stuff including the need for "arg-names". Missed the documentation:
    "Using the 'argNames' attribute is a little clumsy, so if the 'argNames' attribute has not been specified, then Spring AOP will look at the debug information for the class and try to determine the parameter names from the local variable table."

    Helps to read. Thanks for the tip!!!

Tags for this Thread

Posting Permissions

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