Jsr181HandlerMapping : Wrong scan for annotated beans - initializing even lazy 
beans.
-------------------------------------------------------------------------------------

                 Key: XFIRE-926
                 URL: http://jira.codehaus.org/browse/XFIRE-926
             Project: XFire
          Issue Type: Bug
          Components: Spring
    Affects Versions: 1.2.5
            Reporter: Jara Cesnek
         Assigned To: Dan Diephouse


Jsr181HandlerMapping should be rewrited to scan only already constructed beans 
.. not explicitly construct all available  beans even they dont want to.

now:
    String[] beanNames = beanFactory.getBeanDefinitionNames();
    bean = beanFactory.getBean(beanNames[i]);    //wrong - instance all beans

solution : 
  Jsr181HandlerMapping  implements BeanPostProcessor

    public Object postProcessBeforeInitialization(Object bean, String beanName) 
throws BeansException {
        Class clazz = null;
        try
        {
            clazz = SpringUtils.getUserTarget(bean).getClass();
        }
        catch (Exception e)
        {
            logger.error("Failed to get the User Target Class of bean " + 
beanName, e);
        }

        if (clazz != null &&  webAnnotations.hasWebServiceAnnotation(clazz))
        {
            Service endpoint = serviceFactory.create(clazz);
            customizeService(bean, endpoint);
        }
        else
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Rejected bean '" + beanName + "' since it has no 
WebService annotation");
            }
        }

        return bean;
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to