Youtube Data API v3 using Google service account java -
I am integrating the video upload feature in my website using the #google service account and I am using YouTube Data Ape 3 I am using the library. / P>
When I run the code below, I run the time exception. Please help me .. thanks in advance ..
This is my Java code ..
package com.a2z.integration.youtube; Import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets; Import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; Import com.google.api.client.http.HttpTransport; Import com.google.api.client.http.javanet.NetHttpTransport; Import com.google.api.client.json.JsonFactory; Import com.google.api.client.json.jackson.JacksonFactory; Import com.google.api.services.youtube.YouTube; Import com.google.api.services.youtube.YouTube Actions; Import java.io.file; Import java.io.InputStreamReader; Import java.util.ArrayList; Import java.util.list; / ** * * * Author * Sunil * / Public Sector ServiceEightToken {Last Fixed HTTP Transport = New Net HTTPS Transport;); Stable JsonFactory JSON_FACTORY = New Jacksonfactor (); Public static zero master (string [] g) throws exception {list & lt; String & gt; Scoops = new & lt; String & gt; ArrayList (); Scops.add ("https://www.googleapis.com/auth/youtube"); GoogleCredentialCertential = New GoogleCredential.Builder () .setTransport (TRANSPORT) .setJsonFactory (JSON_FACTORY) .setServiceAccountId (constants.SERVICE_ACCOUNT_ID) .setServiceAccountScopes (scops) .setServiceAccountPrivateKeyFromP12File (new file ("key.p12")) // setClientSecrets (" ******. Apps.googleusercontent.com "," ") .setClientSecrets (GoogleClientSecrets.load (JSON_FACTORY, new InputStreamReader (java.io.Reader.class.getResourceAsstream (" client_secrets.json ")))). Construction (); Youtube youtube = new youtube.bilder (transport, jsan_factory, credential) .setApplicationName ("glowing-scene-655"). Build (); Actions Act = youtube.activities (); the verbs. List list = act.list ("s"); }}
The exception that I'm getting in the console:
Run: Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus. Jackson .jsonfactory.configure (Lorg / codehaus / jackson / jsongenerator $ feature, z) Lorg / codehaus / jackson / jsonfactory; Com.google.api.client.json.jackson.JacksonFactory On & lt; Init & gt; (Jacksonfighter. Java: 48) at com.a2z.integration.youtube.ServiceAuthToken & lt; Clinit & gt; (ServiceAuthToken.java:28) Java Result: 1 Successful Success (Total Time: 0 seconds)
Comments
Post a Comment