Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

seeing a lot of log entries with java.lang.NoSuchMethodError: com.amazonaws.services.cloudwatch.AmazonCloudWatch.putMetricData(Lcom/amazonaws/services/cloudwatch/model/PutMetricDataRequest;)Lcom/amazonaws/services/cloudwatch/model/PutMetricDataResult; #32

Closed
ttaranov opened this issue Aug 14, 2016 · 15 comments

Comments

@ttaranov
Copy link

I'm seeing a lot of stack traces around AmazonCloudWatch.putMetricData in logs while running this library:

steps to reproduce:
clone this repo ,
mvn clean install
cd target/
java -jar dynamodb-cross-region-replication-1.1.0.jar --sourceEndpoint https://dynamodb.us-east-1.amazonaws.com --sourceTable --destinationEndpoint https://dynamodb.us-west-2.amazonaws.com --destinationTable

replication does appear to work, however the kcl.log is full of these stack traces

2016-08-14 17:01:37,044 ERROR com.amazonaws.services.kinesis.metrics.impl.CWPublisherRunnable - Caught exception thrown by metrics Publisher in CWPublisherRunnable
java.lang.NoSuchMethodError: com.amazonaws.services.cloudwatch.AmazonCloudWatch.putMetricData(Lcom/amazonaws/services/cloudwatch/model/PutMetricDataRequest;)Lcom/amazonaws/services/cloudwatch/model/PutMetricDataResult;
at com.amazonaws.services.kinesis.metrics.impl.DefaultCWMetricsPublisher.publishMetrics(DefaultCWMetricsPublisher.java:63)
at com.amazonaws.services.kinesis.metrics.impl.CWPublisherRunnable.runOnce(CWPublisherRunnable.java:144)
at com.amazonaws.services.kinesis.metrics.impl.CWPublisherRunnable.run(CWPublisherRunnable.java:90)
at java.lang.Thread.run(Thread.java:745)

@alexmnyc
Copy link

Same here

@dkryeziu
Copy link

I'm having the same error, any solution ?

@mool
Copy link

mool commented Oct 13, 2016

I'm having the same error :-(

@viyatgandhi
Copy link

viyatgandhi commented Oct 21, 2016

same error - replication does work but constantly getting this error. I think error is related to some kinesis dependency, as it got updated and didn't account for this library?

@tohyongcheng
Copy link

Getting the same error here too

@ericeijkelenboom
Copy link

Same here. After a couple of these errors the Java process dies silently. Can't get replication to work.

@nandita1711
Copy link

worked for me finally! use the following dependencies in build.sbt

"org.apache.spark" % "spark-streaming-kinesis-asl_2.11" % "2.1.0",
"org.apache.spark" % "spark-streaming_2.11" % "2.1.0",
"org.apache.spark" % "spark-core_2.11" % "2.1.0",
"org.apache.spark" % "spark-sql_2.11" % "2.1.0"

@snkinard
Copy link

I'm also seeing this issue.

@anmolnar
Copy link

anmolnar commented Feb 9, 2017

@nandita1711 where have you put those dependencies?
I cannot find build.sbt in the repo.

@nandita1711
Copy link

@dolphy17 if you have built your spark application in scala, you will have a build.sbt file where external dependencies are added.
This is similar to pom.xml file in maven.

@patrick-armitage
Copy link

@nandita1711 any ideas for a fix in maven / pom.xml?

@grayaii
Copy link

grayaii commented Apr 13, 2017

I'm pretty sure the code to push metrics to cloudwatch is broken, specifically https://github.com/awslabs/dynamodb-cross-region-library/blob/master/src/main/java/com/amazonaws/services/dynamodbv2/streams/connectors/DynamoDBReplicationEmitter.java#L411

Even if you update all the AWS versions in the pom.xml, you will still get the error.

If you update the bleeding edge, like this:

        <aws.java.sdk.version>1.11.119</aws.java.sdk.version>
        <amazon.kinesis-client-library.version>1.7.5</amazon.kinesis-client-library.version>
        <amazon.kinesis-connectors.version>1.2.0</amazon.kinesis-connectors.version>
        <dynamodb-streams-kinesis-adapter.version>1.1.0</dynamodb-streams-kinesis-adapter.version>

You will get compilation errors on that exact line (which is also throwing the exception).

Since it's broken, and I don't want a see a bazillion lines of the same exception in the logs, i just commented that line and rebuilt.

I wish I knew how to fix it, since it would be beneficial to have cloudwatch metrics, but I really don't know to fix it :(

@grayaii
Copy link

grayaii commented Apr 13, 2017

Oh, it looks like someone created a working PR here:
#35
Awesome!!!

@amcp amcp added the duplicate label Apr 16, 2017
@amcp
Copy link
Contributor

amcp commented Apr 16, 2017

This issue will be fixed by the SDK / KCL / Connector version update described elsewhere. Closing as a duplicate

@amcp amcp closed this as completed Apr 16, 2017
@amcp
Copy link
Contributor

amcp commented Apr 16, 2017

#31

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests