У меня возникла эта проблема
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor () Ljava / util / concurrent / Executor;
при использовании API Big Query от Google.
Я использую JSF, GlassFish 4.1.
Мой метод вызывает исключение:
public void process() throws InterruptedException, FileNotFoundException, IOException {
GoogleCredentials credentials;
File credentialsPath = new File("/home/jesus_miranda/Downloads/credential2.json"); // TODO: update to your key path.
try (FileInputStream serviceAccountStream = new FileInputStream(credentialsPath)) {
credentials = ServiceAccountCredentials.fromStream(serviceAccountStream);
}
// Instantiate a client.
BigQuery bigquery = BigQueryOptions.newBuilder().setCredentials(credentials).build().getService();
String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build();
for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) {//At this line the program failed.
for (FieldValue val : row) {
System.out.printf("%s,", val.toString());
}
System.out.printf("\n");
}
}
Пожалуйста, помогите мне, я прочитал много форумов, и все они говорили о версии гуавы. Я обновляю и понижаю версию гуавы, и она все еще не работает.
С уважением!