1

I am using SocialAuth libraries to authenticate against Facebook in my jsf application. I am getting java.lang.reflect.InvocationTargetException exception with no message from org.brickred.socialauth.SocialAuthManager

The probable statement causing this is:

String providerUrl = manager.getAuthenticationUrl(Common.FACEBOOK_AS_ID, Common.SOCIAL_AUTH_REDIRECT_URL);

Any clue guys. Any helps will be greatly appreciated.

Abhishek Dhote
  • 1,638
  • 10
  • 41
  • 62

2 Answers2

2

I just encountered the same issue today trying to authenticate via Facebook with socialauth-4.0.

The solution is really simple, just make sure that the three jars (openid4java.jar, json-20080701.jar, commons-logging-1.1.jar) that are inside the folder dependencies (inside the zip archive of socialauth) are available at runtime.

In my case I had to put them in the lib folder of my tomcat installation.

Davz
  • 1,530
  • 11
  • 24
0

This exception is throw if the method called threw an exception. Just unwrap the cause within the InvocationTargetException and you'll get to the original one.

try{
  String providerUrl = manager.getAuthenticationUrl(Common.FACEBOOK_AS_ID, Common.SOCIAL_AUTH_REDIRECT_URL);
}catch (InvocationTargetException ex) { 
   System.out.println("oops! "+ ex.getCause()) ;
}

This will tell you the actual problem, so you can resolve that issue.

Tarun Nagpal
  • 964
  • 1
  • 9
  • 25