This is not strictly an issue with the module itself, but search_api_attachments_requirements() in .install reports that it cannot execute a java command. It returns an error,

Error occurred during initialization of VM
Unable to load native library: libjava.jnilib

when it runs,

  exec('java -version');

When I run it on command line, there is no problem. It seems it is either permission or path issue. Could you help with resolving the issue? I am on OS X 10.6.

Thanks.

Ki

CommentFileSizeAuthor
#5 requirements_mamp-1257654-5.patch692 bytestauno

Comments

ki’s picture

Status: Active » Fixed

I have found a fix and share it for others who may have similar situation.

  exec('export DYLD_LIBRARY_PATH=""; java -version');

Inserting export command did the trick. According to http://stackoverflow.com/questions/278868/calling-java-from-php-exec, running JVM under MAMP, which I use, fails without the patch. This may not be an issue with hosting; I will see.

Ki

ki’s picture

I see that class method extract_tika() in callback_attachments_settings.inc already contains code checking for MAMP. So same checking could be implemented in .install since the issue is already known.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

BarisW’s picture

Status: Closed (fixed) » Active

Thanks, same here. Might be an idea to change to hook_requirements()?

I changed
exec(variable_get('apachesolr_attachments_java', 'java') . ' -version > ' . $tmp . ' 2>&1');

into:
exec('export DYLD_LIBRARY_PATH=""; ' . variable_get('apachesolr_attachments_java', 'java') . ' -version > ' . $tmp . ' 2>&1');

And now it works. I'll re-activate this thread as it wasn't solved. The maintainer may decide what to do with it.

tauno’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new692 bytes

Patch to match how java is called in extract_tika()

lotyrin’s picture

Status: Needs review » Reviewed & tested by the community
izus’s picture

Assigned: Unassigned » izus

assigning to me for review & merge

izus’s picture

Status: Reviewed & tested by the community » Fixed

Hi,
merged in 7.x-1.x
Thank you all !

izus’s picture

Assigned: izus » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.