It should be the same as the sample when logging in to Twitter, but an error occurs ~ resolution

Introduction

spring-social-twitter implements Twitter login and introduces a sample blog, So I got stuck when I was making a copy.

In the first place, I couldn't find any example of spring-social-twitter + Spring Boot login. I tried several of them until I got to this sample and it didn't work, so I was wondering if the sample was wrong. After a few hours of struggle, I was able to resolve it, so I will write about the process.

Fighting errors

スクリーンショット 2018-05-29 0.56.27.png

There is an error in ProviderSignInUtils, which is red in the screenshot. The error message is [Java] The constructor ProviderSignInUtils(ConnectionFactoryLocator, UsersConnectionRepository) is undefined

It seems that it is output and it is not defined. import Isn't the correct library referenced by mistake? And, In the first place, isn't such a constructor defined? I checked.

Apparently import is correct compared to sample, [Reference](https://docs.spring.io/autorepo/docs/spring-social/1.1.4.RELEASE/apidocs/org/springframework/social/connect/web/ProviderSignInUtils The same constructor is defined in .html).

Constructor and Description
ProviderSignInUtils(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository connectionRepository)

I can't use something! I do not understand what it means. .. .. .. .. Is the editor bad? I thought, I tried it with Eclipse. While struggling variously, I noticed that if I right-click on the constructor, I can go to the definition source, and when I try it ...

Cause of error

スクリーンショット 2018-05-29 1.07.22.png

The reference source of ProviderSignInUtils is slightly different! The reference source where the error occurs is on the left side of the screen. The editor wasn't wrong because it wasn't defined. (I thought so ...) Looking at the version, it seems that the sample is 2014 and I am implementing 2015.

spring-social-twitter is defined in Maven and is using release 1.1.2.

<dependency> <groupId>org.springframework.social</groupId> <artifactId>spring-social-twitter</artifactId> <version>1.1.2.RELEASE</version> </dependency>

It seems that the sample gradle is used and it is as follows. I don't write a release called gradle. I don't know the version.

dependencies { compile('org.springframework.boot:spring-boot-starter-social-twitter') }

I'm going to update it to the latest version for the time being Official page of spring-social-twitter, But I can't find the description Even on the site I often use MVN Repository, I can't find 1.1.2 in the latest version, but it's just one step away. It was 2 o'clock and it was a weekday, so I stopped because it was about to reach the limit considering tomorrow.

By the way, the official page of spring-social-twitter states that 1.1.0 is the latest version. What happened! スクリーンショット 2018-05-29 22.49.48.png

Problem solved!

The next day, when I looked it up at the end of work, I arrived at a site with the latest release in one shotMVNRepository is the same site as the previous day, but When I search with the query "spring social twitter maven", the page with only the old version is displayed as the search result. By entering the keywords "spring boot social twitter maven" and boot, the latest page is now displayed as search results!

Since I trusted Google search completely, it is unlikely that sites that are not displayed in the former will be displayed in the latter ... This is the era when search ability is important.

Summary

The problem goes away when I sleep! Clean! !!

Recommended Posts

It should be the same as the sample when logging in to Twitter, but an error occurs ~ resolution
Customize the display when an error such as 404 Not Found occurs in Spring Boot
[Ruby] The gem should have been installed in vendor / bundle, but an error occurs in require
What to do and how to install when an error occurs in DXRuby 1.4.7
I want to display an error message when registering in the database
Possibility when deploying to EC2 but nothing is displayed in the error log
[Error resolution] Occurs when trying to build an environment for spring with docker
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
Fighting notes when trying to do the same thing as Java's XOR Mode in C #
An error occurs when codedeploy-agent is installed in Ubuntu Server 20.04
[Programming beginner] What to do when rails s becomes an error in the local development environment
What to do if an error occurs when doing npm install axios in React + Typescript project
An example of a small work when you want to divide the definition value according to the environment but do not want to be aware of it
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
Collecting client information when an error occurs in a web application
How to output the value when there is an array in the array
Determine if the strings to be compared are the same in Java
How to solve the unknown error when using slf4j in Java
Resolved the error that occurred when trying to use Spark in an environment where Java 8 and Java 11 coexist.
Pay.JP Solution when it can be done locally but it does not work well in the production environment
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
An active hash that can be treated as data even if it is not in the database
An error occurred in the free course of RubyOnRails Udemy, solved it, and went through to the end
What to do if an error occurs when nokogiri enters when bundle install
If the JDK version is correct in Eclipse but an error occurs or the compiler does not work properly
An error occurred when executing a function from MyBatis with the OUT parameter set to CURSOR in PostgreSQL.