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

JdbcConnectionRepository is package private which can lead to cglib error #232

Open
pcornelissen opened this issue Jun 14, 2017 · 2 comments

Comments

@pcornelissen
Copy link

pcornelissen commented Jun 14, 2017

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.

@thihara
Copy link

thihara commented Jul 1, 2017

Confirmed. Seeing the same thing.

@tayfunyasar
Copy link

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

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

3 participants