rodhoward / node-sybase

23 stars 55 forks source link

spawn java ENOENT error while connecting to sybase on windows 2012 R2 #3

Closed TusharManhattan closed 8 years ago

TusharManhattan commented 8 years ago

On windows 2012 R2 server the sybase.connect function throws error :1234:

events.js:154 throw er; // Unhandled 'error' event ^

Error: spawn java ENOENT at exports._errnoException (util.js:890:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32) at onErrorNT (internal/child_process.js:348:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) at Function.Module.runMain (module.js:449:11) at startup (node.js:146:18) at node.js:404:3

With the same code running on windows 7 works perfectly fine.

rodhoward commented 8 years ago

I think you will find that the the jar file isn't where its expecting it. You can manually edit the path to the .jar file using the last parameter javaJarPath e.g.: db = new Sybase('host', port, 'dbName', 'username', 'pw', logTiming, javaJarPath);

martvaha commented 8 years ago

Would using var PATH_TO_JAVA_BRIDGE = path.join(__dirname, '..', 'JavaSybaseLink', 'dist', 'JavaSybaseLink.jar'); (i.e. path relative to SybaseDB.js) fix the problem?

jayrungta commented 7 years ago

Why is this issue not fixed yet? It is a simple path error...