spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.

Home Page:http://projects.spring.io/spring-social

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JdbcConnectionRepository is package private which can lead to cglib error

pcornelissen opened this issue · comments

Summary

I have a project that uses spring cloud + a few dependencies and spring-social. When I try to use the JdbcUsersConnectionRepository I get an internal server error:

There was an unexpected error (type=Internal Server Error, status=500).
Error creating bean with name 'scopedTarget.connectionRepository' defined in class path resource [org/springframework/social/config/annotation/SocialConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class org.springframework.social.connect.jdbc.JdbcConnectionRepository]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null

Actual Behavior

JdbcConnectionRepository is package private, which leads to the error above, I don't know exactly what triggers this error in my case and not for others.
You can solve this in two ways:

  1. copy the JdbcConnectionRepository and JdbcUsersConnectionRepository and make JdbcConnectionRepository public.
  2. add these two property settings:
spring:
  aop.proxy-target-class: false
  cloud.netflix.metrics.enabled: false
  1. has the drawback that I have to change the global aop settings which lead to other funny problems, so I had to disable the netflix metrics.

Expected Behavior

No CGLib Exception ;-)
Maybe just make the JdbcConnectionRepository public so CGLib can do it's thing or refactor the JdbcUsersConnectionRepository so that the JdbcConnectionRepository is not used or in another way more CGLib friendly.

Configuration

Version

spring boot 1.5.3, Spring cloud dalston.sr1
<spring-social.version>1.1.4.RELEASE</spring-social.version>
<spring-social-facebook.version>2.0.3.RELEASE</spring-social-facebook.version>

Sample

I tried to create a sample but ran into other problems, maybe I can provide one later.

Confirmed. Seeing the same thing.

I m having same error with spring-social 1.1.4.RELEASE