Hi,
I've defined two beans
To enable a profile I've the following in my web.xml file (http://blog.springsource.com/2011/02...-1-m1-released)HTML Code:<beans profile="dev"> <jdbc:embedded-database id="dataSource" type="H2"> ... </jdbc:embedded-database> </beans> <beans profile="prod"> <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/datasource"/> </beans>
When I run my app I see the following in the consoleHTML Code:<servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> </init-param> <init-param> <param-name>spring.profiles.active</param-name> <param-value>dev</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
Apparently it doesn't take the spring.profiles.active paramCode:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring/data.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource' is defined
Any ideas how to solve this ?
Tim



Reply With Quote