问题描述
我可以使用以下命令启动实例 java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
但是当我尝试做任何其他事情时它给了我以下错误.
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.
2021 年 3 月 15 日下午 2:10:28 com.almworks.sqlite4java.Internal log警告:[sqlite] 无法打开数据库 [15]:com.almworks.sqlite4java.SQLiteException:[-91] 无法加载库: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): 没有找到合适的图像.有没有发现:/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构2021 年 3 月 15 日下午 2:10:28 com.almworks.sqlite4java.Internal log严重:[sqlite] SQLiteQueue[shared-local-instance.db]:运行作业队列时出错com.almworks.sqlite4java.SQLiteException:[-91] 无法加载库:java.lang.UnsatisfiedLinkError:/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:dlopen(/Users/ahsanejaz/Downloads/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib, 1): 没有找到合适的图像.有没有发现:/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构在 com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:97)在 com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1441)在 com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282)在 com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293)在 com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)在 com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)在 com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)在 com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)在 com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)在 java.base/java.lang.Thread.run(未知来源)引起:java.lang.UnsatisfiedLinkError:/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib: dlopen(/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal4_lib/libos1)图像找到.有没有发现:/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构/Users/ahsanejaz/Downloads/dynamodb_local_latest/DynamoDBLocal_lib/libsqlite4java-osx.dylib:通用包装器中没有匹配的架构在 java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)在 java.base/java.lang.ClassLoader$NativeLibrary.load(来源不明)在 java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(来源不明)在 java.base/java.lang.ClassLoader.loadLibrary0(来源不明)在 java.base/java.lang.ClassLoader.loadLibrary(来源不明)在 java.base/java.lang.Runtime.load0(来源不明)在 java.base/java.lang.System.load(来源不明)在 com.almworks.sqlite4java.Internal.tryLoadFromPath(Internal.java:340)在 com.almworks.sqlite4java.Internal.loadLibraryX(Internal.java:117)在 com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:95)... 9 更多2021 年 3 月 15 日下午 2:10:28 com.almworks.sqlite4java.Internal log警告:[sqlite] SQLiteQueue[shared-local-instance.db]:异常停止,转世在 3000 毫秒内
这个问题是否与新的 M1 Apple Silicon 架构有关?有什么解决方法吗?
Is this issure related to new M1 Apple Silicon architecture? Any workaround for this?
推荐答案
我在通过 brew 安装 dynamodb-local 时遇到了同样的问题.显然,正在使用的 sqlite4java 库中没有 arm 版本.例如我得到:
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
有趣的是,使用 docker 预览版,例如使用来自 在您的计算机上本地部署 DynamoDB(在 Docker 选项卡上).
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).
这篇关于M1苹果硅mac上的Dynamodb本地设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!