You have to provide an active profile for current context. This token can be set as:
an Environment Variable
a JVM Property
Web Parameter
Programmatic
Spring also looks for the token, spring.profiles.default, which can be used to set the default profile(s) if none are specified with spring.profiles.active.
Example:
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>spring.profiles.active</param-name>
<param-value>web-dev</param-value>
</init-param>
</servlet>
where applicationContext looks like:
<beans profile="web-dev, test-dev">
<import resource="trace-context.xml"/>
<import resource="spring-data-jpa.xml"/>
<import resource="spring-security-roles.xml" />
</beans>
<beans profile="web-dev">
<bean id="deployProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"
p:location="/WEB-INF/spring.properties" />
<import resource="spring-cache.xml"/>
<import resource="tiles-context.xml" />
<import resource="themes-context.xml" />
</beans>
<beans profile="test-dev">
<bean id="deployProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"
p:location="classpath:spring.properties" />
</beans>