我们有一个现有的(无 Spring)Flex/BlazeDS 应用程序,我们正在迁移它以使用 Spring BlazeDS 集成。在 Maven pom 中,依赖spring-flex-core 1.5.2.RELEASE,这带来了Spring 3.0.5-RELEASE和BlazeDS 4.0.0.14931
我已经从 web.xml 中删除了 flex 配置,而是加载了 Spring。当 Spring 应用程序上下文只包含
<flex:message-broker/>
一切都很好,应用程序继续运行。
问题是当我定义消息目的地时,如下所示:
<flex:message-destination id="BlazeDs2" />
抛出以下错误,非常感谢任何帮助:
03 Apr 2012 17:44:12,737 ERROR main DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with
name 'BlazeDs2': Invocation of init method failed; nested exception is
java.lang.IllegalArgumentException: 'name' must not be null at
org.springframework.beans.factory.support.Abstract
AutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.Abstract
AutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject
(AbstractBeanFactory.java:2 91)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton
(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean
(AbstractBeanFactory.java:288 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.
DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplic ationContext.
finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh
(AbstractApplicationContext.ja va:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext
(FrameworkServlet.java:4 42)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext
(FrameworkServlet.java:4 58)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext
(FrameworkServlet.java:339 )
at org.springframework.web.servlet.FrameworkServlet.initServletBean
(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4420)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4733)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1315)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent
(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:840)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:463)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:525)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.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(Bootst rap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
Caused by: java.lang.IllegalArgumentException: 'name' must not be null
at org.springframework.util.Assert.notNull(Assert.jav a:112)
at org.springframework.beans.factory.BeanFactoryUtils .transformedBeanName
(BeanFactoryUtils.java:70)
at org.springframework.beans.factory.support.
AbstractBeanFactory.transformedBeanName (AbstractBeanFactor y.java:993)
at org.springframework.beans.factory.support.Abstract BeanFactory.containsBean
(AbstractBeanFactory.java: 355)
at org.springframework.flex.core.AbstractDestinationF actory.configureAdapter
(AbstractDestinationFactory .java:168)
at org.springframework.flex.core.AbstractDestinationF actory.afterPropertiesSet
(AbstractDestinationFacto ry.java:75)
at org.springframework.beans.factory.support.Abstract
AutowireCapableBeanFactory.invokeInitMethods
(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.Abstract
AutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 41 more