-
Notifications
You must be signed in to change notification settings - Fork 467
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
ShardRecordProcessorFactory - java.lang.NoClassDefFoundError #625
Comments
Adding the classpath for the maven repo libs individually solved the issue: |
A better solution was the following Maven configurations:
Sorry, I don't know how to paste code os it will format properly. I stole and modified this from: https://crunchify.com/how-to-create-build-java-project-including-all-dependencies-using-maven-maven-resources-maven-dependency-maven-jar-plugin-tutorial/ |
I'm getting a stack trace while I try to run the package I built with Maven:
This is the result of setting up a Maven build environment and using the sample code provided for the Kinesis Client Library v2. Available here:
https://docs.aws.amazon.com/streams/latest/dev/kcl2-standard-consumer-java-example.html
I imagine there is a git repo of this code, but I haven't found it. I looked here: https://github.com/awslabs/amazon-kinesis-client/tree/master/amazon-kinesis-client/src/main/java/software/amazon/kinesis
Maven App Dependencies
<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.28</version> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>sdk-core</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>aws-core</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>regions</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>cloudwatch</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>dynamodb</artifactId> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>kinesis</artifactId> </dependency> <dependency> <groupId>software.amazon.kinesis</groupId> <artifactId>amazon-kinesis-client</artifactId> <version>2.2.4</version> </dependency>
Dependency management
<dependencyManagement> <dependencies> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>bom</artifactId> <version>2.5.10</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
I'm using:
KCL 2.2.4
AWS-SDK 2.9.20 - ( tried 2.9.19, 2.9.10, 2.8.7, 2.5.10 )
Java 1.8.0_45
JRE 1.8.0_45-b14
AWS-SDK 2.9.[19, 10] and 2.8.7 were shots in the dark.
I have read the following issues and have not been able to come up with a solution that would work for me: #266 #323 #577 #485
I tried AWS-SDK 2.5.10 due to the POM file referenced: #350 (comment)
This POM file used AWS-SDK 2.5.10 with KCL 2.2.4.
However, I did not understand what this follow up comment meant: #350 (comment)
#485 #323 and #577 seemed irrelevant
I've tried almost nothing and I'm all out of ideas.
Googling has been less helpful for ideas than the issue search. However, I did come across someone getting a dependency issue for a Google lib. I cannot find it and I am not 100% certain they were using AWS-SDK and KCL, but I think they were. I am mistaking that SO that I cannot find with the one referenced below where they were using older 1.x versions and changing SDK version solved their issue. This is what I would chase next, but I haven't the slightest where to start.
However my shots in the dark were inspired by the following SO: https://stackoverflow.com/questions/37734500/aws-kinesis-client-fails-with-java-lang-noclassdeffounderror
I tried finding which AWS-SDKs were supported by KCL and came up empty. Thus the shots in the dark.
The text was updated successfully, but these errors were encountered: