{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4528","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4528/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4528/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4528/events","html_url":"https://github.com/spring-projects/spring-boot/issues/4528","id":117515318,"number":4528,"title":"1.3.0  @EnableRedisHttpSession  ignoring Profile configuration  ","user":{"login":"jhernandezgt","id":3452489,"avatar_url":"https://avatars.githubusercontent.com/u/3452489?v=3","gravatar_id":"","url":"https://api.github.com/users/jhernandezgt","html_url":"https://github.com/jhernandezgt","followers_url":"https://api.github.com/users/jhernandezgt/followers","following_url":"https://api.github.com/users/jhernandezgt/following{/other_user}","gists_url":"https://api.github.com/users/jhernandezgt/gists{/gist_id}","starred_url":"https://api.github.com/users/jhernandezgt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhernandezgt/subscriptions","organizations_url":"https://api.github.com/users/jhernandezgt/orgs","repos_url":"https://api.github.com/users/jhernandezgt/repos","events_url":"https://api.github.com/users/jhernandezgt/events{/privacy}","received_events_url":"https://api.github.com/users/jhernandezgt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-18T05:17:52Z","updated_at":"2015-11-18T09:24:36Z","closed_at":"2015-11-18T09:24:35Z","body":"Upgrading from 1.2.7 to 1.3.0 is ignoring the current profile in the  configuration and the application startup will fail because keeps trying to connect to a redis instance \r\n```  \r\n@Configuration\r\n@Profile(PROFILE_PROD)\r\n@EnableRedisHttpSession\r\npublic class ProdSessionConfig {\r\n\r\n    @Bean\r\n    HeaderHttpSessionStrategy sessionStrategy() {\r\n        return new HeaderHttpSessionStrategy();\r\n    }\r\n\r\n}\r\n2015-11-17 23:08:56.697  INFO 12356 --- [           main] Application         : The following profiles are active: dev\r\n2015-11-17 23:09:03.973 ERROR 12356 --- [           main] o.s.boot.SpringApplication               : Application startup failed\r\n\r\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:295) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1112) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1101) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/157653842","html_url":"https://github.com/spring-projects/spring-boot/issues/4528#issuecomment-157653842","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4528","id":157653842,"user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T09:24:35Z","updated_at":"2015-11-18T09:24:35Z","body":"The problem isn't that your profile is being ignored, but that [1.3 now provides auto-configuration for Spring Session](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.3-Release-Notes#spring-session). You could either disable the auto-configuration all the time and continue with your current approach or disable it only in your dev profile and use the auto-configuration in production. One way to achieve the latter is to use a profile-specific properties file (`application-dev.properties` and the `spring.autoconfigure.exclude` property."}}