title: Spring Profile doesn't work with Default active profile
body: <p>I am trying to activate spring profile in my application.To do so, </p>
  
  <p><strong>i have added one parameter in web.xml to activate the default profile.</strong></p>
  
  <pre><code>&lt;context-param&gt;
  &lt;param-name&gt;spring.profiles.active&lt;/param-name&gt;
  &lt;param-value&gt;dev&lt;/param-value&gt;
  &lt;context-param&gt;
  </code></pre>
  
  <p>This my jdbc file which manipulates the properties. 
             <strong>and my jdbc.context.xml file is</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &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:p="http://www.springframework.org/schema/p" 
          xmlns:mvc="http://www.springframework.org/schema/mvc"
          xsi:schemaLocation="http://www.springframework.org/schema/beans 
                  http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                  http://www.springframework.org/schema/context
                  http://www.springframework.org/schema/context/spring-context-3.1.xsd
                  http://www.springframework.org/schema/mvc 
                  http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"&gt;    
      &lt;context:property-placeholder location="/WEB-INF/classes/jdbc.properties" /&gt; &lt;!-- TODO: config for different profiles, http://www.javacodegeeks.com/2012/06/spring-31-profiles-and-tomcat.html --&gt;
       &lt;beans profile="dev"&gt;
          &lt;bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"&gt;
              &lt;property name="driverClass" value="${jdbc.driverClassName}"/&gt;
              &lt;property name="jdbcUrl" value="${jdbc.url}"/&gt;
              &lt;property name="user" value="${jdbc.username}"/&gt;
              &lt;property name="password" value="${jdbc.password}"/&gt;
              &lt;/bean&gt;
          &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
              &lt;property name="dataSource"&gt;
                  &lt;ref bean="dataSource" /&gt;
              &lt;/property&gt;
              &lt;property name="packagesToScan" value="com.i2sm.common" /&gt;
              &lt;property name="hibernateProperties"&gt;
                  &lt;props&gt;
                      &lt;prop key="hibernate.dialect"&gt;${jdbc.hibernate.dialect}&lt;/prop&gt;
                      &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;/props&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
    &lt;/beans&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>But when i restart my Tomcat server, it throws me following exception</strong></p>
  
  <pre><code>java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Sun Dec 23 00:57:22 GMT 2012]; root of context hierarchy
          at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:337)
          at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
          at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1030)
          at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993)
          at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548)
          at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
          at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4831)
          at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
          at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
          at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:722)
  
      Any Suggestion?
  </code></pre>