Spring BlazeDS Integration配置错误

时间:2012-04-03 15:51:31

标签: flex spring blazeds spring-flex

我们正在迁移使用Spring BlazeDS Integration的现有(无Spring)Flex / 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 

2 个答案:

答案 0 :(得分:0)

请提供您的services-config.xml web.xml。

同时,in the doc部分7.3到7.6提供了有关消息目的地的有用信息。

答案 1 :(得分:0)

Please change your exposed bean tag to "remoting-destination" from "message-destination",
e.g:-
<flex:remoting-destination ref="myService" />

Make sure your "web.xml" file looks like somewhat this

"<web-app>
<display-name>dzone-server</display-name>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/application-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map /spring/* requests to the DispatcherServlet -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
</web-app>"