-
Notifications
You must be signed in to change notification settings - Fork 228
java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64-1.0.392 in java.library.path #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👍 this makes writing unit tests using DynamoDB local pretty much impossible without resorting to convoluted mocking ... it would be nice if the Jar shipped with the necessary binaries or avoided using sqlite as a underlying implementation and opted for something like h2 instead? |
sqlite4java will look for the native binaries in the same directory as its jar. So for now, I've placed the following in a lib dir:
And then via my build tool I manually add sqlite4java and its native libraries are available here: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.almworks.sqlite4java%22 |
The basic idea is the same as @tekumara claims. But in my scenario, it can also work with maven/gradle across the version control. First, you need to download the zip file from offcial website. Unzip the file, copy all the System.setProperty("sqlite4java.library.path", "src/test/resources/libs/"); before you initialize a local instance of |
Ok, I dug into this (because this was bothering me) and here is what I found (for the next dev to find this ticket): The important function in question is One of the locations is the Unfortunately in order to just add a jar to your pom or gradle config there needs to be a distributed jar that includes the binaries in the same package. In particular This feels like a real drawback of this particular dependency. I might recommend either publishing a fat jar (for testing) that bundled this together, or picking a different dependency which has better resolution for this problem |
I had a similar problem running local dynamodb under Windows. After making all the files under DynamoDBLocal_lib as "executable" (chmod u+x * under cygwin), this problem went away. |
Is there any progress on this issue? We're facing the same problem and currently we consider giving up on local DynamoDB altogether and resorting to docker containers instead. Native dependencies are being lost both on Windows and MacOS. Also, solutions like setting path to DLLs in Gradle scripts work in some cases only (as long as you use Gradle or Gradle-based run configs in IDEs), and mingling with permissions in FS doesn't sound like something you want to incorporate into your workflow. |
Not an example. Just bad quality code, AWS marketing bullshit not even able to re-use 3rd party code, total waste of time. Scammers. |
Running test DynamoDBEmbeddedTest.java throws following exception for me:
|
Seems like there are some dependencies missing in the examples. Here's what made it work for me:
More details can be found in this StackOverflow answer. |
https://github.com/cashapp/tempest/blob/master/tempest2-testing-jvm/src/main/kotlin/app/cash/tempest2/testing/JvmDynamoDbServer.kt shows how this can be done programmatically, without needing additional build time steps to assemble binaries into extra native lib directories. I added a SO answer adapting this same approach - https://stackoverflow.com/questions/26901613/easier-dynamodb-local-testing/69034936#69034936. It's a pity this isn't better handled in the library itself. |
Stack overflow question:
https://stackoverflow.com/questions/34137043/amazon-dynamodb-local-unknown-error-exception-or-failure/35353377#35353377
Anyone know a way to fix this?
The text was updated successfully, but these errors were encountered: