Hi,
i am trying to use the beans environment profile - new feature of spring-beans-3.1
but it does not work.
This is what i did:
Spring xml:
***********
registration of the profile:Code:<?xml version="1.0" encoding="UTF-8"?> <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:util="http://www.springframework.org/schema/util" xmlns:jms="http://www.springframework.org/schema/jms" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd"> <beans profile="dev"> <bean id="propertyConfigurer" class="com.leadspace.common.spring.EnvConfigurablePropertyPlaceholder"> <property name="propertyFiles"> <list> <value>properties/leadspace.properties</value> <value>properties/custom.properties</value> <value>properties/messaging.properties</value> </list> </property> <property name="envPropertiesFileLocation" value="LEADSPACE_HOME" /> </bean> <!-- ******************* AMQ configuration **********************--> <!-- ********************** Producer ********************************* --> <bean id="jmsSenderTaskExecutor" class="com.leadspace.common.messaging.taskexecutors.JmsSenderTaskExecutor"> <property name="jmsTemplate" ref="jmsTemplate"/> </bean> .......... some more beans here ........ </beans> </beans>
*********************
I see in the log that the "dev" profile has been activated, but nothing works.Code:((KnowledgeControllerServerContext) context).mSpringContext = SpringInitializerProxy.initialize(LeadspaceProperties.getControllerSpring()); ApplicationContext appContext = ((KnowledgeControllerServerContext) context).mSpringContext; FileSystemXmlApplicationContext fileContext = ((FileSystemXmlApplicationContext)(appContext)); fileContext.getEnvironment().setActiveProfiles(LeadspaceProperties.getActiveProfile());
Any ideas what might be the problem?
thanks


Reply With Quote