Announcement Announcement Module
Collapse
No announcement yet.
Error is thrown when declaring a message-destination Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error is thrown when declaring a message-destination

    We have an existing (no Spring) Flex/BlazeDS application which we are in the process of migrating to use Spring BlazeDS Integration. Within the Maven pom, there is dependency on spring-flex-core 1.5.2.RELEASE, and this brings in Spring 3.0.5-RELEASE and BlazeDS 4.0.0.14931

    I have removed the flex configuration from web.xml, and instead load Spring.
    When the Spring application context just includes
    <flex:message-broker/>
    everything is great, and the application continues to function.

    The problem is when I define a message destination, as follows:
    <flex:message-destination id="BlazeDs2" />
    The following error is thrown, any help is greatly appreciated:

    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(Abstract AutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.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.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 42)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 58)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:339 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(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(De legatingMethodAccessorImpl.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.Abstract BeanFactory.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(Abstr actAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1417)
    ... 41 more

  • #2
    Why would you want to set a custom id for the message broker? It is discourage to specify a custom id for the message broker. This is a extract from the spring-flex reference guide,

    Note especially that with the message-broker tag, it is not necessary to assign a custom id to the MessageBroker, and it is in fact discouraged so that you won't have to continually reference it later. The only reason you would ever need to provide a custom id is if you were bootstrapping more than one MessageBroker in the same WebApplicationContext.
    http://static.springsource.org/sprin...-messagebroker

    Comment


    • #3
      I am not setting a custom id for the Message Broker.
      The exception is thrown because of an issue with the Message Destination.

      From what I was able to see today through debugging in Eclipse, I think the exception is thrown because the SERVICE ADAPTOR property is not set (forget whether it was a property on the broker or the destination).

      The question now is: How do I declare a service adaptor bean (or get a reference to the one in the flex messaging-config.xml)? I have not seen any examples of this in the documentation, or that it is necessary to reference a service adaptor, but it appears it is. Any help greatly appreciated, thanks!



      Originally posted by amiladomingo View Post
      Why would you want to set a custom id for the message broker? It is discourage to specify a custom id for the message broker. This is a extract from the spring-flex reference guide,



      http://static.springsource.org/sprin...-messagebroker

      Comment


      • #4
        I got your code wrong. Can you post your configurations?

        Comment

        Working...
        X