Announcement Announcement Module
Collapse
No announcement yet.
strange problem with BeanNameAutoProxyCreator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • strange problem with BeanNameAutoProxyCreator

    Hi at all.
    I have a strange problem with BeanNameAutoProxyCreator.
    My cfg file is:

    <bean id="com.bytecode.osw.interfaces.IObjectLocator" class=".."/>

    <bean id="oswBeanNameProxyCreator"
    class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames"><value>com.bytecode.osw.interface s.I*</value></property>
    <property name="interceptorNames">
    <list>
    <value>myInterceptor</value>
    </list>
    </property>
    </bean>

    But this doesn't work, but if I use:
    <property name="beanNames"><value>com.bytecode.osw.interface s.IObject*</value></property>

    it works!!!

    Can someone help me?

  • #2
    This is quite strange!!!
    What version are you using? could you show the log result?
    following method, from BeanNameAutoProxyCreator source returns true in both cases:
    Code:
      /**
       * Return if the given bean name matches the mapped name.
       * The default implementation checks for "xxx*" and "*xxx" matches.
       * Can be overridden in subclasses.
       * @param beanName the bean name to check
       * @param mappedName the name in the configured list of names
       * @return if the names match
       */
      protected boolean isMatch&#40;String beanName, String mappedName&#41; &#123;
        return &#40;mappedName.endsWith&#40;"*"&#41; && beanName.startsWith&#40;mappedName.substring&#40;0, mappedName.length&#40;&#41; - 1&#41;&#41;&#41; ||
            &#40;mappedName.startsWith&#40;"*"&#41; && beanName.endsWith&#40;mappedName.substring&#40;1, mappedName.length&#40;&#41;&#41;&#41;&#41;;
      &#125;

    Comment


    • #3
      I'm using 1.1.2 vesrion.

      Now I haven't the log , but spring simlply don't cretae a proxy and so the intreceptor
      does'nt fire.
      I have looked at source of isMatch too, and i really don't know why it doese't work.

      Comment

      Working...
      X