title: "URI must not be null", on oauth implemantation
body: <p>The Project had implement Oauth based authentication using resource server. It throws error URI NULL even after passing a url. This is the resource server configuration Im using.</p>
  
  <pre><code>@Configuration
  @EnableResourceServer
  public class ResourceServerConfiguration extends
          ResourceServerConfigurerAdapter {
  
  
       @Autowired
       private AuthenticationEntryPoint customAuthenticationEntryPoint;
  
      private CheckTokenEndpoint point;
  
      @Autowired
      Environment env;
  
      @Bean
      public PasswordEncoder passwordEncoder() {
          return new BCryptPasswordEncoder();
      }
  
  
      @Override
      public void configure(HttpSecurity httpSecurity) throws Exception {
          httpSecurity.exceptionHandling()
          .authenticationEntryPoint(customAuthenticationEntryPoint)
          .and()
          .sessionManagement()
          .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
          .and().authorizeRequests()
           .antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
           .antMatchers(HttpMethod.GET, "/","/node_modules/**", "/assets/**","/app/**").permitAll()
           .antMatchers(HttpMethod.GET, "/system-config.js","/init.js","/index.html").permitAll()
         //  .antMatchers(HttpMethod.GET, "/**").permitAll()
        //   .antMatchers(HttpMethod.GET, "/authenticate").permitAll()
           .anyRequest().authenticated()
           .and()
           .formLogin().permitAll();
  
          httpSecurity.addFilterBefore(getOAuth2AuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class);
          httpSecurity.headers().cacheControl();
      }
  
  
      private OAuth2AuthenticationProcessingFilter getOAuth2AuthenticationProcessingFilter() {
          BearerTokenExtractor tokenExtractor = new BearerTokenExtractor();
          OAuth2AuthenticationManager manager = new OAuth2AuthenticationManager();
          manager.setTokenServices(tokenService());
          OAuth2AuthenticationProcessingFilter filter = new OAuth2AuthenticationProcessingFilter();
          filter.setTokenExtractor(tokenExtractor);
          filter.setAuthenticationManager(manager);
          return filter;
  
      }
  
  
      @Bean
      @Primary
      public ResourceServerTokenServices tokenService() {
          RemoteTokenServices tokenServices = new RemoteTokenServices();
          tokenServices.setClientId(env.getProperty("oauth.clientid"));
          tokenServices.setClientSecret(env.getProperty("oauth.clientsecret"));
          tokenServices.setCheckTokenEndpointUrl(env.getProperty("oauth.token.url"));
          return tokenServices;
      }
  }
  </code></pre>
  
  <p>While accessing the service <a href="http://localhost:9190/irs/categoryMas" rel="nofollow noreferrer">http://localhost:9190/irs/categoryMas</a> using valid token </p>
  
  <p>Header</p>
  
  <pre><code>Authorization   Bearer  bca03ed4-4608-499d-a3fe-60e6e671dea6
  </code></pre>
  
  <p>service returns error : </p>
  
  <pre><code>{
      "timestamp": 1505805120134,
      "status": 500,
      "error": "Internal Server Error",
      "exception": "java.lang.IllegalArgumentException",
      "message": "URI must not be null",
      "path": "/irs/categoryMast"
  }
  </code></pre>
  
  <p>On debugging uriTemplate is null. How can I solve this ?</p>
  
  <p>Let me know if you need any more details.</p>