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

hadoop3-2.2.22 and hadoop3-2.2.23 throws NoSuchMethodError at ServiceOptions.getService #1206

Open
ebyhr opened this issue Jul 5, 2024 · 0 comments

Comments

@ebyhr
Copy link

ebyhr commented Jul 5, 2024

This is the reproduible pom.xml, code snippet and the error message. hadoop3-2.2.21 was no problem.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.trino</groupId>
    <artifactId>test-gcs</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>22</maven.compiler.source>
        <maven.compiler.target>22</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.cloud.bigdataoss</groupId>
            <artifactId>gcs-connector</artifactId>
            <version>hadoop3-2.2.23</version>
            <classifier>shaded</classifier>
        </dependency>
    </dependencies>
</project>
    public static void main(String[] args)
            throws Exception
    {
        String gcsJsonKey = "xxx";
        GoogleCredentials credentials = GoogleCredentials.fromStream(new ByteArrayInputStream(gcsJsonKey.getBytes(UTF_8)))
                .createScoped(ImmutableList.of("https://www.googleapis.com/auth/devstorage.full_control"));

        StorageOptions.newBuilder()
                .setCredentials(credentials)
                .setProjectId("Galaxy")
                .build()
                .getService();
    }
Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.String com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.storage.HttpStorageOptions.getUniverseDomain()'
	at com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.storage.StorageImpl.getOptions(StorageImpl.java:1614)
	at com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.storage.StorageImpl.<init>(StorageImpl.java:108)
	at com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.storage.HttpStorageOptions$HttpStorageFactory.create(HttpStorageOptions.java:325)
	at com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.storage.HttpStorageOptions$HttpStorageFactory.create(HttpStorageOptions.java:296)
	at com.google.cloud.hadoop.repackaged.gcs.com.google.cloud.ServiceOptions.getService(ServiceOptions.java:540)
	at io.trino.Main.main(Main.java:35)
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

1 participant