Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

gwt - Native libraries not found in Tomcat

I developed an GWT application which includes some native libraries with JNI. when I test it from eclipse everything works fine, but when I try to deploy it on my Eclipse server it can't find the native libraries.

I followed this tutorial for JNI and Tomcat

but it still can't find them I noticed. That when I read the java.library.path from within my serversided application it is different from what I get when I start Tomcat (displaying the path variables with set path).

Any ideas what I am missing?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The simplest answer might be to edit your Tomcat installation's bin/startup script to change the java.library.path to wherever you're copying the native library to. Something like

java -Djava.library.path=/path/to/my/libs existing args

If you're using a shared hosting provider, you'll need to consult with the owner to determine if they'll allow native libraries to be loaded into the container, and if there's a specific location to which the libraries should be copied.

Beyond that, there's the meta problem of your development environment being different from your deployment environment. Ideally, you would have an exact copy (or as close as possible) of the deployment configuration running on your local development machine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...