Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

spring-social-showcase-boot gives error when booting in Eclipse #53

Open
robertobsc opened this issue Mar 15, 2016 · 2 comments
Open

spring-social-showcase-boot gives error when booting in Eclipse #53

robertobsc opened this issue Mar 15, 2016 · 2 comments

Comments

@robertobsc
Copy link

Hi @habuma , hope you are doing fine!!

I am getting error when booting spring-social-showcase-boot in Eclipse. I am running as Java Application as spring boot allows.

Seems that it is not getting the spring social configuration, cause the error is:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.social.facebook.api.Facebook] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

@wimdeblauwe
Copy link

I managed to get it starting by doing the following changes:

  1. In build.gradle, depend on the latest Spring boot version:

classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")

  1. Also in build.gradle, do not override the versions of spring-social anymore:

compile("org.springframework.social:spring-social-facebook")
compile("org.springframework.social:spring-social-facebook-web")
compile("org.springframework.social:spring-social-config")

  1. Add an application.properties file in src/main/resources:

spring.social.facebook.app-id=
spring.social.facebook.app-secret=

After doing this, it still failed because of a similar exception for LinkedIn and Twitter. Since I don't need those at the moment, I added a @Profile("linkedin") and @Profile("twitter") to the classes in org.springframework.social.showcase.linkedin and org.springframework.social.showcase.twitter. If starting without any profile, then Spring Boot will no longer complain that the controllers need that, since they are not started.

I guess that if you want linkedin or twitter, you need to add similar properties in application.properties with linkedin or twitter replacing facebook.

@wimdeblauwe
Copy link

Note that the above makes the application start, but still does not work with Facebook. For that you need to change signin.html. Replace:

<input type="hidden" name="scope" value="read_stream,user_posts,user_photos"></input>

With:

<input type="hidden" name="scope" value="email"></input>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants