title: Invocation of init method failed; nested exception is java.util.NoSuchElementException
body: <p>I'm trying to get Granite's Gravity to work with my project which is Flex 4.6, Spring 3.1.1 and Tomcat 7 but I'm stuck on an error and I'm getting no solution on the NET. Below is an extract of my Spring applicationContext.xml file :</p>
  
  <hr>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:graniteds="http://www.graniteds.org/config"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.0.xsd
      http://www.graniteds.org/config http://www.graniteds.org/public/dtd/2.3.0/granite-config-2.3.xsd"&gt;
  
  &lt;graniteds:messaging-destination id="gravity" no-local="true" session-selector="true"/&gt;
  </code></pre>
  
  <hr>
  
  <p>When I start tomcat I get the following error which occur on the above graniteds line :</p>
  
  <pre><code>19 Sep 2012 9:24:52 AM org.apache.catalina.core.StandardContext listenerStart
  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 'gravity': Invocation of init method failed; nested exception is java.util.NoSuchElementException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
  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:294)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:662)
  Caused by: java.util.NoSuchElementException
  at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:375)
  at java.util.LinkedHashMap$ValueIterator.next(LinkedHashMap.java:388)
  at org.granite.spring.MessagingDestination.afterPropertiesSet(MessagingDestination.java:40)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
  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:294)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:914)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:386)
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:617)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  at java.util.concurrent.FutureTask.run(FutureTask.java:139)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:909)
      ... 1 more
  </code></pre>
  
  <hr>
  
  <p>I have the granite libraries in my war file and the normal graniteDS messaging works except for the Gravity stuff as it stops the Granite service when it hits the above error.</p>
  
  <p>What am I forgetting to do ?</p>