Compiling jFFI, Redhat Enterprise Linux, and Warbler

Does anyone have experience building jffi
for a specific platform and inserting the jar into a war file created by
warbler?

I deployed a war file on a Redhat Enterprise Linux machine in a Tomcat
servlet container.

The server returns the following error message:
org.jruby.rack.RackInitializationException: Could not load FFI Provider:
FFI not available: No such file or directory and refers me to
http://jira.codehaus.org/browse/JRUBY-4583 for more information.

According to the ticket, I need to build the jffi as outlined. Once I
build jffi, do I just include it in the warbler config file as a jar.

Will the war’ed rails application know where to find the FFI provider?

Thanks,
Yin

We have jffi builds for 32- and 64-bit Linux already, so this is
probably an issue of not being able to either load or find the jffi
library.

Try setting JAVA_OPTS=-Djruby.native.verbose=true before starting
Tomcat and see if there’s more information in the log file about
library loading when the original error occurs.

/Nick

Thanks Nick. Still getting the same error. A longer version of the log
is at:
http://pastie.org/1683832

In addition, nothing unusual noted in the catalina startup log at:
http://pastie.org/1683848

Some notes:
Built the latest ffi jar on the Redhat Linux system following the
directions in the 4583 ticket and placed the generated jffi.jar,
jffi-complete.jar, and jffi-i386-linux.jar in the lib directory of
WEB_INF - no luck.

The warbled war file works without out issue in a tomcat6 container on
my local Mac machine. It is only when deploying to our production Redhat
Enterprise Linux that the error occurs.

The load fails at line 69 in ffi.rb which reads:
require ‘ffi-internal.so’

Any thoughts. Am I missing something obvious?
Thanks!
Yin

Nick S. wrote in post #987931:

We have jffi builds for 32- and 64-bit Linux already, so this is
probably an issue of not being able to either load or find the jffi
library.

Try setting JAVA_OPTS=-Djruby.native.verbose=true before starting
Tomcat and see if there’s more information in the log file about
library loading when the original error occurs.

/Nick

As I suspected, we had a custom tomcat installation that moved library
paths around. The war file deploys now without issue. Thanks for
everyone’s eyeballs. Sorry to clutter the mailing list.

After further tinkering, I think it might have something to do with the
class paths of our custom tomcat6 install.

When packaging the war file as an executable with “warble executable
war”, the war file deploys without any errors.

When rebuilding this war file with “warble” and placing the file in the
webapps directory of our tomcat6 directory, the error from above occurs.

Will report additional findings. Thanks for everyone’s time.

I did not see you mentioning the jruby version you are using. FYI
jruby-1.6.0.RCx had some classloader issues with the jffi native
libraries. jruby-1.6.0 should work, at least the issues which were
reported until now.

if you use jruby-1.5.x maybe give jruby-1.6.0 a try.

that are just my thoughts reading that thread

regards, Kristian