我已将来自 aws-dynamodb-examples 的 DynamoDB 流适配器演示的代码合并到我的 Maven 项目中,但出现运行时错误:
Exception in thread "Thread-2" java.lang.NoClassDefFoundError: com/amazonaws/util/json/JSONObject
at com.amazonaws.services.kinesis.leases.impl.Lease.toString(Lease.java:229)
知道为什么会发生这种情况以及我能做些什么来解决它吗?
我的 pom 文件是这样的:
<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>com.aligntech</groupId>
<artifactId>dynamodbstream</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dynamodbstream</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>dynamodb-streams-kinesis-adapter</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
</project>