简体   繁体   English

:java.lang.NoSuchMethodError:com.amazonaws.services.s3.transfer.TransferManager。<init> (S3;Ljava/util/concurrent/ThreadPoolExecutor;)V</init>

[英]: java.lang.NoSuchMethodError: com.amazonaws.services.s3.transfer.TransferManager.<init>(S3;Ljava/util/concurrent/ThreadPoolExecutor;)V

I am trying to read redshift table data into red-shift data frame and writing that dataframe in another redshift table.我正在尝试将红移表数据读取到红移数据框中,并将 dataframe 写入另一个红移表。 Using following.jar in spark_submit for this task.在 spark_submit 中使用 following.jar 来完成这个任务。

Here is the command:这是命令:

spark-submit --jars RedshiftJDBC41-1.2.12.1017.jar,minimal-json-0.9.4.jar,spark-avro_2.11-3.0.0.jar,spark-redshift_2.10-2.0.0.jar,aws-java-sdk-sqs-1.11.694.jar,aws-java-sdk-s3-1.11.694.jar,aws-java-sdk-core-1.11.694.jar --packages org.apache.hadoop:hadoop-aws:2.7.4 t.py 

I tried changing the version of all the jar and hadoop-aws version as well accordingly as mentioned in various stackoverflow answer with no luck.我尝试更改所有 jar 的版本和 hadoop-aws 版本以及在各种 stackoverflow 答案中提到的相应版本,但没有成功。

Traceback (most recent call last):
  File "/home/ubuntu/trell-ds-framework/data_engineering/data_migration/t.py", line 21, in <module>
    .option("tempdir", "s3a://AccessKey:AccessSecret@big-query-to-rs/rs_temp_data") \
  File "/home/ubuntu/spark-2.3.0-bin-hadoop2.7/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 172, in load
  File "/home/ubuntu/spark-2.3.0-bin-hadoop2.7/python/lib/py4j-0.10.6-src.zip/py4j/java_gateway.py", line 1160, in __call__
  File "/home/ubuntu/spark-2.3.0-bin-hadoop2.7/python/lib/pyspark.zip/pyspark/sql/utils.py", line 63, in deco
  File "/home/ubuntu/spark-2.3.0-bin-hadoop2.7/python/lib/py4j-0.10.6-src.zip/py4j/protocol.py", line 320, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o37.load.
: java.lang.NoSuchMethodError: com.amazonaws.services.s3.transfer.TransferManager.<init>(Lcom/amazonaws/services/s3/AmazonS3;Ljava/util/concurrent/ThreadPoolExecutor;)V
    at org.apache.hadoop.fs.s3a.S3AFileSystem.initialize(S3AFileSystem.java:287)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2669)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
    at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2703)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2685)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:373)
    at com.databricks.spark.redshift.Utils$.assertThatFileSystemIsNotS3BlockFileSystem(Utils.scala:124)
    at com.databricks.spark.redshift.RedshiftRelation.<init>(RedshiftRelation.scala:52)
    at com.databricks.spark.redshift.DefaultSource.createRelation(DefaultSource.scala:49)
    at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:340)
    at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:239)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:227)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:214)
    at java.lang.Thread.run(Thread.java:748)

2019-12-21 14:38:03 INFO  SparkContext:54 - Invoking stop() from shutdown hook
2019-12-21 14:38:03 INFO  AbstractConnector:318 - Stopped Spark@3c115b0a{HTTP/1.1,[http/1.1]}{0.0.0.0:4040}
2019-12-21 14:38:03 INFO  SparkUI:54 - Stopped Spark web UI at http://ip-172-30-1-193.ap-south-1.compute.internal:4040
2019-12-21 14:38:03 INFO  MapOutputTrackerMasterEndpoint:54 - MapOutputTrackerMasterEndpoint stopped!

Can any body help me out here about what could be the issue?任何人都可以帮我解决可能是什么问题吗? Is it library issue of.jar or hadoop or something else?是 .jar 或 hadoop 的图书馆问题还是其他问题?

Thanks.谢谢。

I ran into a similar kind of error few days back.几天前我遇到了类似的错误。

I could able to resolve by upgrading the 'aws-java-sdk-s3' jar to the latest version.我可以通过将 'aws-java-sdk-s3' jar 升级到最新版本来解决。

For my case I was using the s3a connector and pyspark on SageMaker with Hadoop 2.7.3 jars. To fix it, I needed to install the following jars hadoop-aws-2.7.3.jar and aws-java-sdk-1.7.4.jar . For my case I was using the s3a connector and pyspark on SageMaker with Hadoop 2.7.3 jars. To fix it, I needed to install the following jars hadoop-aws-2.7.3.jar and aws-java-sdk-1.7.4.jar . This resolved my issue instead of using the documented aws-java-sdk-bundle jar.这解决了我的问题,而不是使用记录的aws-java-sdk-bundle jar。

My code:我的代码:

builder = SparkSession.builder.appName('appName')
builder = builder.config('spark.jars', 'hadoop-aws-2.7.3.jar,aws-java-sdk-1.7.4.jar')
spark = builder.getOrCreate()

I had the same issue while using spark-shell.我在使用 spark-shell 时遇到了同样的问题。

The issue was that the jar was loaded at the end of all jars, I moved it at the beginning and the issue was resolved.问题是罐子是在所有罐子的末尾加载的,我在开始时移动了它,问题就解决了。

as the s3a troubleshooting docs say正如s3a 故障排除文档所说

Do not attempt to “drop in” a newer version of the AWS SDK than that which the Hadoop version was built with Whatever problem you have, changing the AWS SDK version will not fix things, only change the stack traces you see不要尝试“插入”比 Hadoop 版本构建时使用的更新版本的 AWS SDK 无论您遇到什么问题,更改 AWS SDK 版本都不会解决问题,只会更改您看到的堆栈跟踪

stop using 8 year old hadoop 2.7 binaries, upgrade to a version of spark with 3.3.1 binaries and try again停止使用 8 岁的 hadoop 2.7 二进制文件,升级到带有 3.3.1 二进制文件的 spark 版本,然后重试

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Lambda Java 到 S3 - com.amazonaws.services.s3.AmazonS3ClientBuilder 上的 java.lang.ClassNotFoundException - AWS Lambda Java to S3 - java.lang.ClassNotFoundException on com.amazonaws.services.s3.AmazonS3ClientBuilder Pyspark S3 错误:java.lang.NoClassDefFoundError:com/amazonaws/services/s3/model/MultiObjectDeleteException - Pyspark S3 error: java.lang.NoClassDefFoundError: com/amazonaws/services/s3/model/MultiObjectDeleteException 使用 Amazon S3 配置 Pyspark 给出 java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider - Configuring Pyspark with Amazon S3 giving java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider Pyspark s3 错误:java.lang.NoClassDefFoundError:com/amazonaws/AmazonServiceException - Pyspark s3 error : java.lang.NoClassDefFoundError: com/amazonaws/AmazonServiceException PYSPARK 连接到 aws S3 时出错:py4j.protocol.Py4JJavaError:java.lang.NoClassDefFoundError:com/amazonaws/AmazonClientException - PYSPARK Error connecting to aws S3: py4j.protocol.Py4JJavaError: java.lang.NoClassDefFoundError: com/amazonaws/AmazonClientException AWS S3 - java.net.UnknownHostException: repo-user-bucket.s3.us-west-2.amazonaws.com - AWS S3 - java.net.UnknownHostException: repo-user-bucket.s3.us-west-2.amazonaws.com java.lang.NoSuchMethodError: 'com.google.api.gax.rpc.StubSettings$Builder com.google.cloud.pubsub.v1.stub.SubscriberStubSettings$Builder.setBackground - java.lang.NoSuchMethodError: 'com.google.api.gax.rpc.StubSettings$Builder com.google.cloud.pubsub.v1.stub.SubscriberStubSettings$Builder.setBackground java.lang.NoSuchMethodError 在 class Ljava.lang.Object 中没有名称='getStatusCode' signature='()I' 的非静态方法; - java.lang.NoSuchMethodError no non-static method with name='getStatusCode' signature='()I' in class Ljava.lang.Object; java.lang.NoSuchMethodError: 'boolean com.google.api.client.http.HttpTransport.isMtls() - java.lang.NoSuchMethodError: 'boolean com.google.api.client.http.HttpTransport.isMtls() java.lang.NoSuchMethodError: 'com.microsoft.aad.msal4j.SilentParameters$SilentParametersBuilder 使用 azure sdk 用于 java 服务总线 - java.lang.NoSuchMethodError: 'com.microsoft.aad.msal4j.SilentParameters$SilentParametersBuilder using azure sdk for java service bus
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM