API Google NLP дает Не удалось найти поставщика TLS ALPN;нет доступных нетто-tcnative, Conscrypt или Jetty NPN / ALPN - PullRequest
0 голосов
/ 26 ноября 2018

Я пытаюсь использовать Google API для обработки естественного языка.Я добавляю библиотеки, используя Maven, и добавляю GOOGLE_APPLICATION_CREDENTIALS в качестве переменной среды, которая имеет путь к файлу JSON, который содержит мой ключ учетной записи службы.

Это дает мне ошибку;Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available

try (LanguageServiceClient language = LanguageServiceClient.create()) {

            // The text to analyze
            String text = "Hello, world!";
            Document doc = Document.newBuilder()
                    .setContent(text).setType(Type.PLAIN_TEXT).build();

            // Detects the sentiment of the text
            Sentiment sentiment = language.analyzeSentiment(doc).getDocumentSentiment();

            System.out.printf("Text: %s%n", text);
            System.out.printf("Sentiment: %s, %s%n", sentiment.getScore(), sentiment.getMagnitude());
        }catch(Exception e){
            System.out.println("Gevindu Error "+ e.getMessage());
        }
...