Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#395 closed defect (incomplete)

Xapian binding make check failed on java binding: wrong architecture, UnsatisfiedLink

Reported by: Yeung William Owned by: Olly Betts
Priority: normal Milestone:
Component: Xapian-bindings Version: 1.0.14
Severity: major Keywords:
Cc: LarsR Blocked By:
Blocking: Operating System: Mac OS X

Description (last modified by Olly Betts)

I got the following failure when I try to build xapian-bindings

Making check in .
make  check-TESTS
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/goodwill/build/xapian-bindings-1.0.14/java/native/.libs/libxapian_jni.jnilib:  no suitable image found.  Did find:  /Users/goodwill/build/xapian-bindings-1.0.14/java/native/.libs/libxapian_jni.jnilib: mach-o, but wrong architecture  /Users/goodwill/build/xapian-bindings-1.0.14/java/native/.libs/libxapian_jni.jnilib: mach-o, but wrong architecture
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1881)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1798)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1047)
        at org.xapian.XapianJNI.<clinit>(XapianJNI.java:44)
        at org.xapian.Stem.<init>(Stem.java:60)
        at SmokeTest.main(SmokeTest.java:42)
FAIL: SmokeTest.class
=======================================
1 of 1 tests failed

Change History (14)

comment:1 by Olly Betts, 15 years ago

Description: modified (diff)

It would be useful to know what architecture it has built libxapian_jni.jnilib for, and what architecture it was expecting it to be. I don't know how to do that on OS X though.

comment:2 by Yeung William, 15 years ago

I don't know how as well... could that task generate a bit more debug info so I could give you more detail report? My environment is 10.5.8 Mac OS X on Intel Core2Duo CPU.

comment:3 by Olly Betts, 15 years ago

You could try:

file /Users/goodwill/build/xapian-bindings-1.0.14/java/native/.libs/libxapian_jni.jnilib

If that doesn't help, I'm not sure. James may know and will hopefully chip in.

comment:4 by James Aylett, 15 years ago

That file command should output something like:

/Users/goodwill/build/xapian-bindings-1.0.14/java/native/.libs/libxapian_jni.jnilib: Mach-O bundle i386

I'd want to also find out if there's anything in /Users/goodwill/build/xapian-bindings-1.0.14/java/built/ (I have libxapian_jni.jnilib and xapian_jni.jar there, although the former may disappear during a successful build run of 1.0.14).

comment:5 by Yeung William, 15 years ago

the latter file is there, not the one with lib*. Anything I can help finding out from there?

comment:6 by James Aylett, 15 years ago

Can you please run the file command olly suggested?

comment:7 by Yeung William, 15 years ago

Hmm weird... file xapian_jni.jar xapian_jni.jar: Zip archive data, at least v2.0 to extract

comment:8 by James Aylett, 15 years ago

Please run file on the .jnilib file (in …/.libs), not the .jar file.

comment:9 by Olly Betts, 15 years ago

If this is still an issue, can you try running file on the .jnilib? My guess is that java needs either 32 or 64 bit code in the .jnilib and the other is built by default - if so, this isn't hard to work around.

If you've already resolved this, please let us know (and ideally also how you resolved it!) so we can close this ticket.

comment:10 by Olly Betts, 15 years ago

Ping - can you try running "file" as requested in comment:3 (on the .jnilib, not the .jar)?

comment:11 by Olly Betts, 15 years ago

Resolution: incomplete
Status: newclosed

No response to multiple requests for further information, so resolving as "incomplete".

If anyone can reproduce this and is able and willing to supply the requested information, please do so and we can reopen this ticket.

comment:12 by LarsR, 15 years ago

Perhaps you already did this, but you should make sure that the .c files for the JNI library are compiled with '-arch x86_64' because the newer Java 1.6 on mac is a 64 bit binary, and to link in code it must be compiled for that. The error message says that it can find the file, but that there is no matching binary code to load, which suggests that it has been compiled to the default 32 bit arch. BTW, since OSX has fat binaries, it is ok to compile in many different archs, both 32 and 64 bits, and x86 and ppc.

comment:13 by Olly Betts, 15 years ago

Cc: LarsR added

larsr: Yes, that was what we were trying to establish - running file on the .jnilib should report what

If you have Mac OS X and can reproduce this, it would be great to actually fix this issue if you're willing to help.

comment:14 by Olly Betts, 15 years ago

Um, I got cut off somehow.

"running file on the .jnilib should report what architecture(s) it was compiled for"

Note: See TracTickets for help on using tickets.