Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...