Abhijith12 / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

getOAuthRequestToken error #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Nabeel

I got this exception when hitting the following line in
OAuthAuthenticationExample: 
LinkedInRequestToken requestToken = oauthService.getOAuthRequestToken();

Fetching request token from LinkedIn...
Exception in thread "main" java.lang.ExceptionInInitializerError
    at javax.crypto.Mac.getInstance(DashoA13*..)
    at
oauth.signpost.signature.HmacSha1MessageSigner.sign(HmacSha1MessageSigner.java:4
2)
    at oauth.signpost.AbstractOAuthConsumer.sign(AbstractOAuthConsumer.java:62)
    at
oauth.signpost.basic.DefaultOAuthProvider.retrieveToken(DefaultOAuthProvider.jav
a:119)
    at
oauth.signpost.basic.DefaultOAuthProvider.retrieveRequestToken(DefaultOAuthProvi
der.java:66)
    at
com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthReques
tToken(LinkedInOAuthServiceImpl.java:64)
    at
com.google.code.linkedinapi.client.examples.OAuthAuthenticationExample.main(OAut
hAuthenticationExample.java:67)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.SunJCE_b.<clinit>(DashoA13*..)
    ... 7 more
Caused by: java.lang.SecurityException: Cannot locate policy or framework
files!
    at javax.crypto.SunJCE_b.i(DashoA13*..)
    at javax.crypto.SunJCE_b.g(DashoA13*..)
    at javax.crypto.SunJCE_b$1.run(DashoA13*..)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 8 more

Do you know why it happen?
Quyen

Original issue reported on code.google.com by thucquye...@gmail.com on 15 Dec 2009 at 10:43

GoogleCodeExporter commented 8 years ago
Seems like an issue with your jdk. Which version are you using?
I will need to do a bit more research on it as I have never encountered that
exception before.

Thanks for your help.

Regards
Nabeel Mukhtar

Original comment by nabeelmukhtar on 15 Dec 2009 at 4:39

GoogleCodeExporter commented 8 years ago
Hi Nabeel,

I found out the problem: i used jre6 and the app needs javax.crypto.sun class 
which
is not included in jre6. So i installed jdk6 and the problem solved. I can run
successfully the OAuthAuthenticationExample now.

Original comment by thucquye...@gmail.com on 15 Dec 2009 at 8:24

GoogleCodeExporter commented 8 years ago

Original comment by nabeelmukhtar on 16 Dec 2009 at 7:56