javaamazon-web-servicesamazon-dynamodbendpointamazon-dynamodb-local

Cannot connect to local DynamoDB


I cannot connect to DynamoDB that is running local using cli.

aws dynamodb list-tables --endpoint-url http://localhost:8000

Could not connect to the endpoint URL: "http://localhost:8000/"

This doesn't work either: aws dynamodb list-tables --region local Could not connect to the endpoint URL: "http://localhost:8000/"

I tried using a different port and that didn't help. I disabled all proxies too. I am able to connect to DynamoDB using an application like this so I know it's not a dynamodb issue: aws dynamodb list-tables --endpoint-url http://dynamodb.us-west-2.amazonaws.com --region us-west-2

{ "TableNames": [ "Music" ] }

😭😭😭


Solution

  • The error in your logs is the key here Caused by: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64 in java.library.path: [.]

    This means that the specific dependency cannot be located.

    The link that Saranjeet provided has a few solutions. I prefer this solution for testing:

    First, you need to download the zip file from offcial website. Unzip the file, copy all the *.dll, *.dylib, *.so to a folder under your project root. Say, src/test/resources/libs.
    Then, add the code
    
    System.setProperty("sqlite4java.library.path", "src/test/resources/libs/");
    before you initialize a local instance of AmazonDynamoDB.