Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法连接到Amazon Dynamo DB,grails_Java_Grails_Amazon Ec2_Nosql_Amazon Dynamodb - Fatal编程技术网

Java 无法连接到Amazon Dynamo DB,grails

Java 无法连接到Amazon Dynamo DB,grails,java,grails,amazon-ec2,nosql,amazon-dynamodb,Java,Grails,Amazon Ec2,Nosql,Amazon Dynamodb,大家好,我有一个Amazon DynamoDB,表名为test。我有这样一个grails控制器: def ec2Test = { def tableName = new DescribeTableRequest() tableName.setTableName("test") def createdTable = amazonWebService.dynamoDB.describeTable(tableName) } {TableName: Testing ta

大家好,我有一个Amazon DynamoDB,表名为test。我有这样一个grails控制器:

def ec2Test = {
    def tableName = new DescribeTableRequest()
    tableName.setTableName("test")
    def createdTable = amazonWebService.dynamoDB.describeTable(tableName)
    }
{TableName: Testing table, KeySchema: {HashKeyElement: {AttributeName: name, AttributeType: S, }, }, TableStatus: CREATING, CreationDateTime: Mon Oct 01 12:23:37 IST 2012, ProvisionedThroughput: {ReadCapacityUnits: 10, WriteCapacityUnits: 10, }, }
但当我尝试点击这个控制器时,我得到:

未找到请求的资源:表:未找到自动测试表

尽管我可以在浏览器中看到aws dynamo DB中有一个表名测试。。在我的grails config.groovy中,我还添加了以下几行:

grails.plugin.awssdk.accessKey = "xxxxxxx"
grails.plugin.awssdk.secretKey = "xxxxxxx"

grails.plugin.awssdk.region = "ap-southeast-1"
我在哪里犯了错误?我还尝试创建表格,并打印结果,结果如下:

def ec2Test = {
    def tableName = new DescribeTableRequest()
    tableName.setTableName("test")
    def createdTable = amazonWebService.dynamoDB.describeTable(tableName)
    }
{TableName: Testing table, KeySchema: {HashKeyElement: {AttributeName: name, AttributeType: S, }, }, TableStatus: CREATING, CreationDateTime: Mon Oct 01 12:23:37 IST 2012, ProvisionedThroughput: {ReadCapacityUnits: 10, WriteCapacityUnits: 10, }, }
我等了大约15分钟。刷新了浏览器,我无法看到尚未创建的表!我用于创建表的代码是:

String tableName = "Testing Table";
CreateTableRequest createTableRequest = new CreateTableRequest().withTableName(tableName)
                        .withKeySchema(new KeySchema(new KeySchemaElement().withAttributeName("name").withAttributeType("S")))
                        .withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(10L).withWriteCapacityUnits(10L));
    TableDescription createdTableDescription = amazonWebService.dynamoDB.createTable(createTableRequest).getTableDescription();
    println createdTableDescription

提前感谢。

您使用的是哪种Aws插件?这张。你是在找你在ap-Southwest-1创建的同一地区的表吗?是的。我只关注ap-Southwest-1地区。但是使用sdk我可以访问DB值并使用它。但是这样的表的创建在AWS Web UI中是不可见的。这看起来确实是一个区域问题,您应该尝试使用AWS控制台检查其他区域。