ICIJ / node-tika

Apache Tika bridge for Node.js. Text and metadata extraction, language detection and more.
MIT License
140 stars 36 forks source link

Module did not self-register #11

Closed moxious closed 8 years ago

moxious commented 8 years ago

I'm attempting to use node-tika in a project that builds/tests via CircleCI. Their CI environment installs various things for me, but when my server attempts to start it fails as follows:

[17:54:45] Using gulpfile ~/ow-back/gulpfile.js
[17:54:45] Starting 'syncdb'...
[17:54:45] Finished 'syncdb' after 288 ms
[17:54:45] Starting 'serve'...
[17:54:46] 'serve' errored after 240 ms
[17:54:46] Error: Module did not self-register.
    at Error (native)
    at Object.Module._extensions..node (module.js:450:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/ubuntu/ow-back/node_modules/tika/node_modules/java/lib/nodeJavaBridge.js:10:16)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/ubuntu/ow-back/node_modules/tika/node_modules/java/index.js:2:18)
    at Module._compile (module.js:425:26)

CircleCI appears to be running ubuntu, and JAVA_HOME=/usr/lib/jvm/jdk1.7.0 to give you a sense of my java version.

It appears this is some kind of java incompatibility issue, but what are the troubleshooting steps associated with fixing this?

moxious commented 8 years ago

From my packages.json: "tika": "^1.3.0"

moxious commented 8 years ago

Extremely suspicious about this, note the error message references /home/ubuntu/ow-back/node_modules/tika/node_modules/java/lib/nodeJavaBridge.js. In my local dev installed copy of node-tika, that file doesn't exist. Is it possible it's using a wrong version somehow?

mattcg commented 8 years ago

Hi @moxious, did you ever solve this issue in the end?

moxious commented 8 years ago

I never got to the root cause. I did solve it through a mixture of downgrading node, upgrading java, and removing node_modules but I was never sure what actually did it.