Announcement Announcement Module
Collapse
No announcement yet.
Upgrade spring-flex from 1.0.3 to 1.5.2 causes NullPointerException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrade spring-flex from 1.0.3 to 1.5.2 causes NullPointerException

    Hi,

    I have been trying to upgrade spring-flex 1.0.3 to 1.5.2 in order to check new features, i.e. Hibernate lazy fetching support in BlazeDS 4. I downloaded all necessary packages, changed dependencies in Maven for Spring (to 3.0.7), Hibernate (to 3.6.9) and Spring flex core (to 1.5.2). When I try to build and deploy application, I got NullPointerException which indicates cause in my domain class (at the end of stack trace):

    Code:
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is java.lang.NullPointerException
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
            at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
            at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
            at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
            at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
            at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
            at org.apache.catalina.core.StandardService.start(StandardService.java:519)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is java.lang.NullPointerException
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
            at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:396)
            at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095)
            at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:294)
            at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
            at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
            at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
            at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
            at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
            at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)
            at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
            ... 35 more
    Caused by: org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is java.lang.NullPointerException
            at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:203)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
            ... 54 more
    Caused by: java.lang.NullPointerException
            at com.educationathome.domain.Device.toString(Device.java:182)
            at java.lang.String.valueOf(String.java:2826)
            at java.lang.StringBuilder.append(StringBuilder.java:115)
            at org.springframework.flex.core.io.PropertyProxyUtils.getBeanPropertyNames(PropertyProxyUtils.java:71)
            at org.springframework.flex.core.io.PropertyProxyUtils.findPropertyNames(PropertyProxyUtils.java:80)
            at org.springframework.flex.core.io.SpringPropertyProxy.proxyFor(SpringPropertyProxy.java:85)
            at org.springframework.flex.core.io.AbstractAmfConversionServiceConfigProcessor.registerAmfProxies(AbstractAmfConversionServiceConfigProcessor.java:115)
            at org.springframework.flex.core.io.AbstractAmfConversionServiceConfigProcessor.processAfterStartup(AbstractAmfConversionServiceConfigProcessor.java:73)
            at org.springframework.flex.core.MessageBrokerFactoryBean.processAfterStart(MessageBrokerFactoryBean.java:315)
            at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:177)
            ... 56 more


    I appreciate any supportive replies.

    Thank you, Michal.

  • #2
    Same problem - upgrade Spring-flex from 1.0.3 to 1.5.2 causes NPE

    Hi Michal,
    I have got exactly the same problem, under the same conditions. Upgrading from spring-flex from 1.0.3 to 1.5.2 causes NullPointerException in one of our domain attribute.toString() methods. Same stack trace.

    Did you find the cause, and a solution to this?

    Comment

    Working...
    X