{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/441","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/441/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/441/events","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/441","id":95228355,"number":441,"title":"@EnableFeignClients - NullPointerException encoder in FeignClientFactoryBean","user":{"login":"steve-oakey","id":3990563,"avatar_url":"https://avatars.githubusercontent.com/u/3990563?v=3","gravatar_id":"","url":"https://api.github.com/users/steve-oakey","html_url":"https://github.com/steve-oakey","followers_url":"https://api.github.com/users/steve-oakey/followers","following_url":"https://api.github.com/users/steve-oakey/following{/other_user}","gists_url":"https://api.github.com/users/steve-oakey/gists{/gist_id}","starred_url":"https://api.github.com/users/steve-oakey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steve-oakey/subscriptions","organizations_url":"https://api.github.com/users/steve-oakey/orgs","repos_url":"https://api.github.com/users/steve-oakey/repos","events_url":"https://api.github.com/users/steve-oakey/events{/privacy}","received_events_url":"https://api.github.com/users/steve-oakey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-15T15:53:35Z","updated_at":"2015-07-26T10:14:34Z","closed_at":null,"body":"I am using release train Angel.SR3. I am having the same issue as raised in gh-212. When `FeignClientFactoryBean` tries to build the Feign clients, `encoder` as well as all other autowired fields are null.\r\n\r\nBasically I have:\r\n\r\n* Main class annotated with `@SpringCloudApplication` and `@EnableFeignClients`\r\n* An interface `UserClient` annotated with `@FeignClient`\r\n* A class 'CompositeService` annotated @Service and autowiring `UserClient` (initializing this bean is where the failure occurs).\r\n\r\nLooking at the DEBUG logs, the beans from `FeignAutoConfiguration` are not created until after the initialization of the above bean fails. I have tried putting `@EnableFeignClients` on the main class, a separate `@Configuration` class and a static inner class of another `@Configuration` class, all with the same result.\r\n\r\nI have successfully used `@EnableFeignClients` in other sample projects I have made, so I am sure that the custom configuration I am providing is likely causing some timing issue. I am providing a number of custom auto-configuration classes that I am providing myself from an external library + 1 Bootstrap configuration.\r\n\r\nI cannot produce a sample to reproduce because I am on a closed network and I am really having a hard time tracking down where the configuration problem may be in order to provide a reproducible sample. If someone could provide some ideas on what I should look for when debugging that would be really helpful. I can provide as much information as needed from logs and stack traces.\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/comments/124966976","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/441#issuecomment-124966976","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/441","id":124966976,"user":{"login":"jmnarloch","id":1581045,"avatar_url":"https://avatars.githubusercontent.com/u/1581045?v=3","gravatar_id":"","url":"https://api.github.com/users/jmnarloch","html_url":"https://github.com/jmnarloch","followers_url":"https://api.github.com/users/jmnarloch/followers","following_url":"https://api.github.com/users/jmnarloch/following{/other_user}","gists_url":"https://api.github.com/users/jmnarloch/gists{/gist_id}","starred_url":"https://api.github.com/users/jmnarloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmnarloch/subscriptions","organizations_url":"https://api.github.com/users/jmnarloch/orgs","repos_url":"https://api.github.com/users/jmnarloch/repos","events_url":"https://api.github.com/users/jmnarloch/events{/privacy}","received_events_url":"https://api.github.com/users/jmnarloch/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T10:14:34Z","updated_at":"2015-07-26T10:14:34Z","body":"I have an exact log for comparision of working and failing setup. It turns out that fallback from Spring Security 4.0.1.RELASE to 3.2.8.RELEASE solved this problem in my case.\r\n\r\nPlease see: https://gist.github.com/jmnarloch/66f41c6904f97f84cef4\r\nIn the log title working you can see entries BeanPostProcessorChecker: feignDecoder ...\r\n\r\nThe same does not happen when you have Spring Security 4.0.1 on the classpath. I wonder why."}}