Announcement Announcement Module
No announcement yet.
Error is thrown when declaring a message-destination Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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

    I have removed the flex configuration from web.xml, and instead load Spring.
    When the Spring application context just includes
    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 AutowireCapableBeanFactory.initializeBean(Abstract
    at AutowireCapableBeanFactory.doCreateBean(AbstractAu
    at AutowireCapableBeanFactory.createBean(AbstractAuto
    at BeanFactory$1.getObject( 91)
    at ingletonBeanRegistry.getSingleton(DefaultSingleton
    at BeanFactory.doGetBean( )
    at BeanFactory.getBean(
    at istableBeanFactory.preInstantiateSingletons(Defaul
    at ationContext.finishBeanFactoryInitialization(Abstr
    at ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext( 42)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext( 58)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext( )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(
    at it(
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
    at org.apache.catalina.core.StandardWrapper.loadServl et(
    at org.apache.catalina.core.StandardWrapper.load(Stan
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(
    at org.apache.catalina.core.StandardContext.start(Sta
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(
    at org.apache.catalina.core.ContainerBase.addChild(Co
    at org.apache.catalina.core.StandardHost.addChild(Sta
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(
    at org.apache.catalina.startup.HostConfig.deployApps(
    at org.apache.catalina.startup.HostConfig.start(HostC
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(
    at org.apache.catalina.core.ContainerBase.start(Conta
    at org.apache.catalina.core.StandardHost.start(Standa
    at org.apache.catalina.core.ContainerBase.start(Conta
    at org.apache.catalina.core.StandardEngine.start(Stan
    at org.apache.catalina.core.StandardService.start(Sta
    at org.apache.catalina.core.StandardServer.start(Stan
    at org.apache.catalina.startup.Catalina.start(Catalin
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at org.apache.catalina.startup.Bootstrap.start(Bootst
    at org.apache.catalina.startup.Bootstrap.main(Bootstr
    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(
    at BeanFactory.transformedBeanName(AbstractBeanFactor
    at BeanFactory.containsBean( 355)
    at org.springframework.flex.core.AbstractDestinationF actory.configureAdapter(AbstractDestinationFactory .java:168)
    at org.springframework.flex.core.AbstractDestinationF actory.afterPropertiesSet(AbstractDestinationFacto
    at AutowireCapableBeanFactory.invokeInitMethods(Abstr
    at AutowireCapableBeanFactory.initializeBean(Abstract
    ... 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.


    • #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,


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