[ 
http://jira.codehaus.org/browse/XFIRE-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100758
 ] 

Alexis Kinsella commented on XFIRE-926:
---------------------------------------

in class Jsr181HandlerMapping, in method, it tries to verify a bean that is 
initialized later (Hessian Proxy on a remote service), it generates the 
following exception :


51060 [main] ERROR org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping - 
Failed to get the User Target Class of bean remoteSmeConnectorBeanManager
java.lang.NullPointerException
        at 
org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.processBeans(Jsr181HandlerMapping.java:117)
        at 
org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.initApplicationContext(Jsr181HandlerMapping.java:65)
        at 
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
        at 
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:72)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:301)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at 
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
        at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
        at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
        at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at 
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
        at 
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at 
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
        at org.mortbay.jetty.Server.doStart(Server.java:210)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at ...



The only Workaround is to change the bean scope to "prototype", but it is not a 
valid workaround, since it changes  the way the bean is  meant to be used.



> 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
>            Assignee: 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