Uploaded image for project: 'Spring Social'
  1. Spring Social
  2. SOCIAL-470

Null-pointer exception when calling sign-in with twitter.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hello,

      I have a sign-in with Twitter functionality on my website and it was working fine for a few months. Then I upgraded to 1.1.2.RELEASE and now I try to login with twitter i get redirected to twitter, I click on sign in but then i come back to my website and I get a null-pointer exception:

      2015-06-08 23:52:42,862 org.springframework.social.connect.web.ProviderSignInController [http-nio-127.0.0.1-8111-exec-1] ERROR: Exception while completing OAuth 1.0(a) connection: 
      java.lang.NullPointerException
      	at org.springframework.social.oauth1.AuthorizedRequestToken.getValue(AuthorizedRequestToken.java:46)
      	at org.springframework.social.oauth1.OAuth1Template.exchangeForAccessToken(OAuth1Template.java:130)
      	at org.springframework.social.connect.web.ConnectSupport.completeConnection(ConnectSupport.java:143)
      	at org.springframework.social.connect.web.ProviderSignInController.oauth1Callback(ProviderSignInController.java:203)
      	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 org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
      	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221

      I also tried downgrading to version 1.1.0 I get this exception:

      2015-06-08 23:45:36,278 org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/storefront].[dispatcherServlet] [http-nio-8112-exec-6] ERROR: Servlet.service() for servlet [dispatcherServlet] in context with path [/storefront] threw exception
      org.springframework.data.redis.serializer.SerializationException: Cannot serialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.io.NotSerializableException: org.springframework.social.connect.support.ConnectionFactoryRegistry
      	at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.serialize(JdkSerializationRedisSerializer.java:52)
      	at org.springframework.data.redis.core.AbstractOperations.rawHashValue(AbstractOperations.java:166)
      	at org.springframework.data.redis.core.DefaultHashOperations.putAll(DefaultHashOperations.java:128)
      	at org.springframework.data.redis.core.DefaultBoundHashOperations.putAll(DefaultBoundHashOperations.java:85)
      	at org.springframework.session.data.redis.RedisOperationsSessionRepository$RedisSession.saveDelta(RedisOperationsSessionRepository.java:409)
      	at org.springframework.session.data.redis.RedisOperationsSessionRepository$RedisSession.access$000(RedisOperationsSessionRepository.java:331)
      	at org.springframework.session.data.redis.RedisOperationsSessionRepository.save(RedisOperationsSessionRepository.java:211)
      	at org.springframework.session.data.redis.RedisOperationsSessionRepository.save(RedisOperationsSessionRepository.java:141)
      	at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.commitSession(SessionRepositoryFilter.java:172)
      	at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.access$100(SessionRepositoryFilter.java:151)
      	at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:113)
      	at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:65)
      	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
      	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
       

        Activity

        Hide
        juan.pablo.tejela@gmail.com Juan Pablo added a comment -

        I have the same issue from 3 days ago. Previously it worked perfectly for me. I am using now 1.1.2.RELEASE but I was using 1.1.0.RELEASE when it started.

        Any ideas?

        Show
        juan.pablo.tejela@gmail.com Juan Pablo added a comment - I have the same issue from 3 days ago. Previously it worked perfectly for me. I am using now 1.1.2.RELEASE but I was using 1.1.0.RELEASE when it started. Any ideas?
        Hide
        juan.pablo.tejela@gmail.com Juan Pablo added a comment -

        I have found my problem. It was related to a session lost in my server because of a configuration issue.

        Show
        juan.pablo.tejela@gmail.com Juan Pablo added a comment - I have found my problem. It was related to a session lost in my server because of a configuration issue.
        Hide
        yev yevgen added a comment -

        Juan, I'm facing the same issue and I can't found what's wrong. Could you share what was wrong for you and how did you fixed it?

        Show
        yev yevgen added a comment - Juan, I'm facing the same issue and I can't found what's wrong. Could you share what was wrong for you and how did you fixed it?
        Hide
        juan.pablo.tejela@gmail.com Juan Pablo added a comment -

        Ohh, I'm sorry, but It was a NPE related to an object that I expect to be in session but it wasn't. My problem wasn't related with Spring Social. I fixed authenticating the user again using Spring Security cookie. I can't really remember, but I think that the problem was that some requests were going to one server and other requests were going to a different server.

        Show
        juan.pablo.tejela@gmail.com Juan Pablo added a comment - Ohh, I'm sorry, but It was a NPE related to an object that I expect to be in session but it wasn't. My problem wasn't related with Spring Social. I fixed authenticating the user again using Spring Security cookie. I can't really remember, but I think that the problem was that some requests were going to one server and other requests were going to a different server.

          People

          • Assignee:
            habuma Craig Walls
            Reporter:
            ptahchiev Petar Tahchiev
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: