Dynamo DB - ClassDefFoundError:com / amazonaws / ClientConfigurationFactory

时间:2017-06-29 16:11:04

标签: java maven amazon-dynamodb

我的pom.xml中有一个依赖od dynamo DB

<dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-dynamodb</artifactId>
        <version>1.11.70</version>
    </dependency>
    <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

到目前为止工作正常,但突然间它开始出现以下错误

引起:java.lang.NoClassDefFoundError:com / amazonaws / ClientConfigurationFactory     at java.lang.ClassLoader.defineClass1(Native Method)〜[na:1.8.0_111]     在java.lang.ClassLoader.defineClass(ClassLoader.java:763)〜[na:1.8.0_111]     在java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)〜[na:1.8.0_111]     在org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2558)〜[catalina.jar:8.0.38]     在org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:859)〜[catalina.jar:8.0.38]     在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302)~ [catalina.jar:8.0.38]     在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)〜[catalina.jar:8.0.38]     在com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient。(AmazonDynamoDBClient.java:230)〜[aws-java-sdk-dynamodb-1.11.70.jar:na]     在com.medlife.dynamoDb.client.DynamoDbStarter.init(DynamoDbStarter.java:56)〜[dynamoDb-services-1.0.54.jar:na]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_111]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_111]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_111]     在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_111]



有人知道这个解决方案

1 个答案:

答案 0 :(得分:0)

com/amazonaws/ClientConfigurationFactory是AWS SDK核心模块的一部分。

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-core</artifactId>
    <version>1.11.70</version>
</dependency>

上述依赖项(aws-java-sdk-core)包含在aws-java-sdk-dynamodb中。

请检查maven本地存储库是否具有核心模块。否则,您只需运行mvn clean install命令即可​​从远程存储库获取依赖项。

本地存储库路径: -

C:\Users\userid\.m2\repository\com\amazonaws\aws-java-sdk-core\1.11.70