dynamodb mapper scan()中出错:java.lang.nullpointerexception:null

50pmv0ei  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(289)

我打电话时出错了

dynamoDBMapper.scan(Person.class, new DynamoDBScanExpression())
java.lang.NullPointerException: null
    at com.amazonaws.services.dynamodbv2.model.ScanRequest.setScanFilter(ScanRequest.java)
    at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.createScanRequestFromExpression(DynamoDBMapper.java:1692)
    at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.scan(DynamoDBMapper.java:1569)
    at com.amazonaws.services.dynamodbv2.datamodeling.AbstractDynamoDBMapper.scan(AbstractDynamoDBMapper.java:236)

同样的 dynamoDBMapper , dynamoDBMapper.save(person1) 工作正常。
这个 NullPointerExecption 正在进入 ScanRequest.setScanFilter 方法。
虽然,方法 setScanFilter 只有一行代码,stacktrace没有显示发生异常的行号。
scanrequest.setscanfilter方法如下所示。

public void setScanFilter(java.util.Map<String, Condition> scanFilter) {
    this.scanFilter = scanFilter;
}

不知道怎么做 this.scanFilter = scanFilter 可能导致nullpointerexception
Spring Boot-2.2.6.释放
dynamodb软件开发包-1.11.555
java -corretto-8.242.08.1

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题