Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NoClassDefFoundError: com/github/scribejava/java8/base64/Java8Base64" error #1028

Open
lennygokhman opened this issue Jan 3, 2022 · 1 comment

Comments

@lennygokhman
Copy link

Hi,

I'm trying to use the YahooApi20 to authenticate via OAuth2.0. This example file I'm able to compile and run in Eclipse: https://github.com/scribejava/scribejava/blob/master/scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Yahoo20Example.java. The service builder successfully gives me a url to authorize, I goto the site, get verifier, paste into terminal, then get the following exception on this piece of code:

final OAuth2AccessToken accessToken = service.getAccessToken(oauthVerifier);

Exception in thread "main" java.lang.NoClassDefFoundError: com/github/scribejava/java8/base64/Java8Base64
at com.github.scribejava.core.base64.Java8Base64.(Java8Base64.java:6)
at com.github.scribejava.core.base64.Base64.createInstance(Base64.java:22)
at com.github.scribejava.core.base64.Base64.getInstance(Base64.java:13)
at com.github.scribejava.core.base64.Base64.encode(Base64.java:45)
at com.github.scribejava.core.oauth2.clientauthentication.HttpBasicAuthenticationScheme.addClientAuthentication(HttpBasicAuthenticationScheme.java:33)
at com.github.scribejava.core.oauth.OAuth20Service.createAccessTokenRequest(OAuth20Service.java:192)
at com.github.scribejava.core.oauth.OAuth20Service.getAccessToken(OAuth20Service.java:237)
at com.github.scribejava.core.oauth.OAuth20Service.getAccessToken(OAuth20Service.java:232)
at yahooAPI.Yahoo20Example.main(Yahoo20Example.java:59)
Caused by: java.lang.ClassNotFoundException: com.github.scribejava.java8.base64.Java8Base64
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 9 more

I've made sure to import commons-codec-1.15, along with scribejava-apis-8.3.1 and scribejava-core-8.3.1 and I'm on Java 11. Any help would be greatly appreciated

@EvanChilds
Copy link

Hey lennygokhman,

I also ran into this issue and resolved it by also including the scribejava-java8 jar in my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants