Reputation: 193
I did a local setup of dynamodb using https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html
I am able to start the instance using the following command java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
but when i try to do anything else it gives me the following error.
Mar 15, 2021 2:10:28 PM com.almworks.sqlite4java.Internal log WARNING: [sqlite] cannot open DB[15]: com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: dlopen(/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 1): no suitable image found. Did find: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper Mar 15, 2021 2:10:28 PM com.almworks.sqlite4java.Internal log SEVERE: [sqlite] SQLiteQueue[shared-local-instance.db]: error running job queue com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: dlopen(/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 1): no suitable image found. Did find: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:97) at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1441) at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282) at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293) at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464) at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641) at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623) at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77) at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.UnsatisfiedLinkError: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: dlopen(/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 1): no suitable image found. Did find: /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper /Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source) at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source) at java.base/java.lang.Runtime.load0(Unknown Source) at java.base/java.lang.System.load(Unknown Source) at com.almworks.sqlite4java.Internal.tryLoadFromPath(Internal.java:340) at com.almworks.sqlite4java.Internal.loadLibraryX(Internal.java:117) at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:95) ... 9 more Mar 15, 2021 2:10:28 PM com.almworks.sqlite4java.Internal log WARNING: [sqlite] SQLiteQueue[shared-local-instance.db]: stopped abnormally, reincarnating in 3000ms
Is this issure related to new M1 Apple Silicon architecture? Any workaround for this?
Upvotes: 19
Views: 14798
Reputation: 523
As of v1.20 DynamoDB Local works on M1 Macs without any extra libraries.
So if you are having this problem, you can likely upgrade rather then relying on third party libraries of uncertain trustworthiness.
Upvotes: 1
Reputation: 1871
You can use newly published Apple Silicon (M1) library. Adding this as a dependency into your project or if you are using a folder based approach copying this file into native libraries path should fix the error:
io.github.ganadist.sqlite4java:libsqlite4java-osx-aarch64:1.0.392
Direct download link: https://repo1.maven.org/maven2/io/github/ganadist/sqlite4java/libsqlite4java-osx-aarch64/1.0.392/libsqlite4java-osx-aarch64-1.0.392.dylib
You can specify custom native library path with sqlite4java.library.path
system property:
# JVM parameter:
-Dsqlite4java.library.path=./native-libs
# or within source code:
System.setProperty("sqlite4java.library.path", "./native-libs")
Upvotes: 14
Reputation: 11
Once you have docker installed can:
docker pull amazon/dynamodb-local:latest
docker run -p 8000:8000 amazon/dynamodb-local:latest
Another way to do it is to use a Docker container and just bind it to the same port you might usually bind it to for ARM architectures.
Upvotes: 1
Reputation: 715
When using Maven, simply add the following dependency:
<dependency>
<groupId>io.github.ganadist.sqlite4java</groupId>
<artifactId>libsqlite4java-osx-aarch64</artifactId>
<version>1.0.392</version>
<type>dylib</type>
<scope>test</scope>
</dependency>
Note that com.almworks.sqlite4java
has not been updated since 2014 so hopefully this will last until the AWS team will switch to another implementation.
Upvotes: 3
Reputation: 381
I was able to run DynamoDB installing a java version x86-64 architecture rather than arm64 and starting it up from a rosetta terminal
java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment Zulu16.30+15-CA (build 16.0.1+9)
OpenJDK 64-Bit Server VM Zulu16.30+15-CA (build 16.0.1+9, mixed mode, sharing)
Upvotes: 9
Reputation: 46
I had the same issue with dynamodb-local installed via brew. Apparently the sqlite4java lib being used does not have an arm version in there. Eg i get:
Caused by: java.lang.UnsatisfiedLinkError: /opt/homebrew/Caskroom/dynamodb-local/latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: dlopen(/opt/homebrew/Caskroom/dynamodb-local/latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 1): no suitable image found. Did find:
/opt/homebrew/Caskroom/dynamodb-local/latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: no matching architecture in universal wrapper
Interestingly the docker image is working fine for me using the docker preview version, eg by using the docker compose file from Deploying DynamoDB Locally on Your Computer (on the Docker tab).
Upvotes: 3