Is there anyone on planet earth who know SocialAuth - SocialAuth throws java.lang.reflect.InvocationTargetException with no message
-
28-06-2021 - |
Question
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.
Solution
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.
OTHER TIPS
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.