title: Exception using RestTemplate after upgrading to springBootVersion = '1.3.3.RELEASE'
body: <p>After upgrading to springBootVersion = '1.3.3.RELEASE' (and, spring-security-oauth2:2.0.9.RELEASE), when we make OAuth2RestTemplate exchange call, we get the below exception on the OAuth2AuthorizationServer. Below, I have listed also all the dependencies on the client side build.gradle. </p>
  
  <p>I appreciate any help.</p>
  
  <pre><code>13:19:50.426 [http-nio-8888-exec-5] WARN  o.s.s.o.p.token.store.JdbcTokenStore/readAuthentication Failed to deserialize authentication for 9a1eea62-2be5-4b43-bdac-b39d6142c4f1
  java.lang.IllegalArgumentException: java.io.InvalidClassException: org.springframework.security.core.authority.SimpleGrantedAuthority; local class incompatible: stream classdesc seri
  alVersionUID = 320, local class serialVersionUID = 400
          at org.springframework.security.oauth2.common.util.SerializationUtils.deserialize(SerializationUtils.java:40)
          at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.deserializeAuthentication(JdbcTokenStore.java:405)
          at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$3.mapRow(JdbcTokenStore.java:198)
          at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$3.mapRow(JdbcTokenStore.java:196)
          at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)
          at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60)
          at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:693)
          at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
          at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
          at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
          at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
          at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:796)
          at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.readAuthentication(JdbcTokenStore.java:195)
          at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.getAccessToken(JdbcTokenStore.java:129)
          at org.springframework.security.oauth2.provider.token.DefaultTokenServices.createAccessToken(DefaultTokenServices.java:84)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
          at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
          at com.sun.proxy.$Proxy67.createAccessToken(Unknown Source)
          at org.springframework.security.oauth2.provider.token.AbstractTokenGranter.getAccessToken(AbstractTokenGranter.java:70)
          at org.springframework.security.oauth2.provider.token.AbstractTokenGranter.grant(AbstractTokenGranter.java:65)
          at org.springframework.security.oauth2.provider.CompositeTokenGranter.grant(CompositeTokenGranter.java:38)
          at org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer$4.grant(AuthorizationServerEndpointsConfigurer.java:561)
          at org.springframework.security.oauth2.provider.endpoint.TokenEndpoint.postAccessToken(TokenEndpoint.java:132)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.flect.Method.invoke(Method.java:497)
          at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)
          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
          at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
          at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
          at org.springframework.security.web.access.intFilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
          at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
         .springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
          at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
          at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
          at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
          at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87)
          at org.springframework.web.ficePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
       ava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
  Caused by: java.io.InvalidClassException: org.springframework.security.core.authority.SimpleGrantedAuthority; local class incompatible: stream classdesc serialVersionUID = 320, local
   class serialVersionUID = 400
          at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)
          at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1623)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
          at java.util.HashSet.readObject(HashSet.java:333)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1900)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStva:1924)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
          at org.springframework.security.oauth2.common.util.SerializationUtils.deserialize(SerializationUtils.java:36)
          ... 118 common frames omitted
  13:19:50.677 [http-nio-8888-exec-5] INFO  o.s.s.o.p.endpoint.TokenEndpoint/handleException Handling error: NullPointerException, null
  13:19:50.693 [http-nio-8888-exec-5] DEBUG o.s.s.w.a.ExceptionTranslationFilter/doFilter Chain processed normally
  13:19:50.693 [http-nio-8888-exec-5] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter/doFilter SecurityContextHolder now cleared, as request processing completed
  </code></pre>
  
  <p>Dependencies on the client build.gradle:</p>
  
  <pre><code>// Spring Boot
    providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.springframework:spring-jdbc")
    compile("org.springframework:spring-tx")
  
    // Spring Boot Security
    compile("org.springframework.boot:spring-boot-starter-security")
    compile("org.springframework.security.oauth:spring-security-oauth2:2.0.9.RELEASE")
    compile('org.springframework.security:spring-security-ldap:4.0.4.RELEASE')
  
    //jaxb xml marshaller
    compile('org.springframework:spring-oxm:4.2.4.RELEASE')
  
    // We will also need Spring Context Support that contains JavaMailSender support class.
    compile("org.springframework:spring-context-support")
  
    // Spring Boot Data Commons - Required for API Pagination
    compile("org.springframework.data:spring-data-commons-core:1.1.0.RELEASE")
  
    // MyBatis
    compile("org.mybatis:mybatis-spring:1.2.3")
    compile("org.mybatis:mybatis:3.3.0")
  
    // BoneCP - Connection Pooling
    compile("com.jolbox:bonecp:0.8.0.RELEASE")
  
    //  compile("org.postgresql:postgresql:9.4-1204-jdbc42")
    compile("com.oracle:ojdbc6:11.2.0.4")
  
    // Vaadin
    compile 'com.vaadin:vaadin-client-compiled:7.6.4'
    compile 'com.vaadin:vaadin-client:7.6.4'
    compile 'com.vaadin:vaadin-themes:7.6.4'
    compile 'com.vaadin:vaadin-server:7.6.4'
    compile 'com.vaadin:vaadin-push:7.6.4'
  
    // Official VaadinSpring Integration
    compile("com.vaadin:vaadin-spring-boot-starter:1.0.0")
  
    //Vaadin extentions - in the future more of those will go to official VaadinSpring Integration
    compile("org.vaadin.spring.extensions:vaadin-spring-ext-security:0.0.7.RELEASE")
    compile("org.vaadin.spring.extensions:vaadin-spring-ext-core:0.0.7.RELEASE")
    compile("org.vaadin.spring.extensions:vaadin-spring-ext-boot:0.0.7.RELEASE")
    compile("org.vaadin.spring.extensions:vaadin-spring-ext-test:0.0.7.RELEASE")
  
    // Vaadin add-ons
    compile("org.vaadin.spring.addons:vaadin-spring-addon-eventbus:0.0.6.RELEASE")
    compile("org.vaadin.spring.addons:vaadin-spring-addon-mvp:0.0.6.RELEASE")
    compile("org.vaadin.spring.addons:vaadin-spring-addon-i18n:0.0.6.RELEASE")
    compile("org.vaadin.addon:confirmdialog:2.1.3")
    compile("org.vaadin.addons:stepper:2.2.2")//numeric stepper
  
  
    compile("javax.mail:mail:1.4.3")
  
    // Lombok
    compile("org.projectlombok:lombok:1.16.6")
  
    compile("com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.6.3")
  
    //Freemarker
    compile("org.freemarker:freemarker:2.3.23")
  
    //Spring Object/XML Marshalling
    compile("org.springframework:spring-oxm:4.2.4.RELEASE")
  
    //Spring-boot test
    testCompile("org.springframework.boot:spring-boot-starter-test")
  
    //Spring security test
    testCompile("org.springframework.security:spring-security-test:4.0.4.RELEASE")
  
    //The DBUnit library, is a common library that can help implement database-related testing
    testCompile("org.dbunit:dbunit:2.5.1")
  
    //H2 database Java Library
    testCompile("com.h2database:h2:1.3.160")
  
    //Apache POI library that supports reading and writing of files in Microsoft Office format
    testCompile("org.apache.poi:poi:3.2-FINAL")
  
    //MockMVC integration tests -&gt; org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath
    testCompile("com.jayway.jsonpath:json-path")
  </code></pre>