title: Spring Oauth2 JdbcTokenStore Oracle Database
body: <p>i'm trying convert the jdbctoken store schema here
  <a href="https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql" rel="nofollow">https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql</a></p>
  
  <p>to </p>
  
  <pre><code>CREATE TABLE EISBIT.OAUTH_ACCESS_TOKEN
  (
    TOKEN_ID           VARCHAR2(256 BYTE),
    TOKEN              CLOB,
    AUTHENTICATION_ID  VARCHAR2(256 BYTE),
    USER_NAME          VARCHAR2(256 BYTE),
    CLIENT_ID          VARCHAR2(256 BYTE),
    AUTHENTICATION     CLOB,
    REFRESH_TOKEN      VARCHAR2(256 BYTE)
  )
  </code></pre>
  
  <p>ths </p>
  
  <pre><code>@Override
  public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
      endpoints
              .tokenStore(tokenStore())
              .authenticationManager(this.authenticationManager);
  }
  </code></pre>
  
  <p>but i get this exception when try a</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2015-07-03 14:34:01.300  WARN 10952 --- [pr-8080-exec-13] o.s.s.o.p.token.store.JdbcTokenStore     : Failed to deserialize access token for b14fa3b1-5a5a-4d0c-9112-416997c2dc83
  
  java.lang.IllegalArgumentException: java.io.StreamCorruptedException: invalid stream header: 00540001
   at org.springframework.security.oauth2.common.util.SerializationUtils.deserialize(SerializationUtils.java:40)
   at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.deserializeAccessToken(JdbcTokenStore.java:397)
   at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$2.mapRow(JdbcTokenStore.java:162)
   at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore$2.mapRow(JdbcTokenStore.java:1)
   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:708)
   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:727)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
   at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:811)
   at org.springframework.security.oauth2.provider.token.store.JdbcTokenStore.readAccessToken(JdbcTokenStore.java:160)</code></pre>
  </div>
  </div>
  </p>
  
  <p>error when try to read the tokenstore :(..</p>