{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1682","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1682/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1682/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1682/events","html_url":"https://github.com/spring-projects/spring-boot/issues/1682","id":45442560,"number":1682,"title":"Adding custom SolrContext configured with zkServer","user":{"login":"rajjaiswalsaumya","id":5713776,"avatar_url":"https://avatars.githubusercontent.com/u/5713776?v=3","gravatar_id":"","url":"https://api.github.com/users/rajjaiswalsaumya","html_url":"https://github.com/rajjaiswalsaumya","followers_url":"https://api.github.com/users/rajjaiswalsaumya/followers","following_url":"https://api.github.com/users/rajjaiswalsaumya/following{/other_user}","gists_url":"https://api.github.com/users/rajjaiswalsaumya/gists{/gist_id}","starred_url":"https://api.github.com/users/rajjaiswalsaumya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajjaiswalsaumya/subscriptions","organizations_url":"https://api.github.com/users/rajjaiswalsaumya/orgs","repos_url":"https://api.github.com/users/rajjaiswalsaumya/repos","events_url":"https://api.github.com/users/rajjaiswalsaumya/events{/privacy}","received_events_url":"https://api.github.com/users/rajjaiswalsaumya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/waiting-for-feedback","name":"waiting-for-feedback","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-10-10T03:22:20Z","updated_at":"2015-05-12T09:13:40Z","closed_at":"2015-05-12T09:13:40Z","body":"I needed to implement custom solr repository as current solr template is not able to meet my requirements. For that when i tried Autowired SolrTemplate, it raise an exception stating that it could not find bean. Hence I wrote a small class which does create a custom SolrContext. But it is not able to interact with zookeeper servers. All the properties are already configured in in application.properties like spring.data.solr.host and spring.data.solr.zkHost. I tried with CloudSolrServer class still bean not found. \r\nAm I missing something? \r\n \r\n```\r\n@Configuration\r\n@EnableConfigurationProperties(SolrProperties.class)\r\n@EnableSolrRepositories(\"org.repository\")\r\n@PropertySource(\"classpath:application.properties\")\r\n\r\npublic class SolrContext {\r\n\r\n    @Resource\r\n    private Environment environment;\r\n\r\n\r\n    @Bean\r\n    public HttpSolrServerFactoryBean solrServerFactoryBean() {\r\n        HttpSolrServerFactoryBean factory = new HttpSolrServerFactoryBean();\r\n        factory.setUrl(environment.getRequiredProperty(\"spring.data.solr.host\"));\r\n\r\n        return factory;\r\n    }\r\n\r\n    @Bean\r\n    public SolrTemplate solrTemplate() throws Exception {\r\n        return new SolrTemplate(solrServerFactoryBean().getObject());\r\n    }\r\n```"}}