Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Problems Finding JNA Library #26

Open
cmiles74 opened this issue Jan 18, 2014 · 5 comments
Open

Problems Finding JNA Library #26

cmiles74 opened this issue Jan 18, 2014 · 5 comments

Comments

@cmiles74
Copy link

I'm using a copy of Stefon that I checked out from the master branch. It builds and installs without issue. It works great from within my REPL environment (Cider) or when launched with a REPL via lein (lein repl). However, when I bundle my application as an uberjar, I'm seeing the following error at the top of my stacktrace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
  Unable to load library '/usr/java/packages/lib/amd64/libv8.so.clj-v8': 
    /usr/java/packages/lib/amd64/libv8.so.clj-v8: 
      cannot open shared object file: No such file or directory

This seems especially odd since I don't have that path ("/usr/java/packages") on my system. I'm invoking my application with the following incantation:

java -Djna.library.path=target/native/linux/x86_64 \
-jar target/scrumboard-0.0.1-SNAPSHOT-standalone.jar

When I comment out my uses of Stefon and set my application to simply write the value of the "jna.library.path" System property, it does show the value I passed in. I've also tried suppling the absolute path to the library, that doesn't work either. I'm using the "x86_64" path since I'm on a 64bit OS (Ubuntu).

I did find the issue where this is being worked on and it looks like the issue was resolved. Indeed, the fact that it works from "lein repl" and from Cider implies that this is an issue that can be resolved. I'm wondering if maybe I'm doing something very obviously wrong.

My end goal is to deploy this application as a WAR via Tomcat. This is currently the way we deploy all of our Java applications, the goal is to get our Clojure apps to deploy in the same manner.

Any help you can provide will be greatly appreciated! Thank you!

@cmiles74
Copy link
Author

I've confirmed that this is an issue when deploying as a WAR on Tomcat7. I'm using "lein ring uberwar" and deploying to a Tomcat7 instance on my workstation. I'm seeing the same error, verbatim, in Tomcat7.

@pbiggar
Copy link
Contributor

pbiggar commented Jan 19, 2014

Related to #9 right? I think the solution is in circleci/clj-v8#7.

Can you update to the latest version of clj-v8, and see if the problem goes away? (If you specify the clj-v8 version first in your project.clj, that should override the version depended on by stefon. Don't try to use a checkouts dir - that doesnt work with native AFAIK).

If so, a PR updating the version is probably the way to go forward.

@pbiggar
Copy link
Contributor

pbiggar commented Jan 19, 2014

CCing @magnars

@magnars
Copy link

magnars commented Jan 19, 2014

The newest version of clj-v8 should be working bundled in an uberjar. It'll detect the correct binary based on your OS and archetype, write it out to a temporary directory, and read it from there. No need to set any JNA paths.

@cbui
Copy link
Contributor

cbui commented Jan 27, 2014

Are there instructions on how to fix this?

This is what I've done:

Checkout stefon, bump version of clj-v8 to 0.1.5. lein install -> uberjar -> running the standalone.

Results in the same error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'v8wrapper': dlopen(libv8wrapper.dylib, 9): image not found

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants