node-sybase icon indicating copy to clipboard operation
node-sybase copied to clipboard

Getting NPE after putting ENCRYPT_PASSWORD=true in sybaseConfig.properties

Open 6harat opened this issue 7 years ago • 2 comments

It seems like the package might be more suitable for linux machines as I am running into issue while doing a development using it on Windows machine.

Error: java.lang.NullPointerException at Socket. (C:\Users\bg48311\devworks\hello-database\node_modules\sybase\src\SybaseDB.js:63:15) at Socket.g (events.js:291:16) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at Pipe.onread (net.js:548:20)

Also, it would be helpful if we could enhance a bit of logging as the above err message does not tell much about where the error came in the JavaSybaseLink.jar

6harat avatar Mar 19 '17 12:03 6harat

Hi Gulats,

I think this is because jconnect.jar its looking for another library to handle the encryption. I haven't packaged that library and I'm not 100% sure how to get this working. I have basically wrapped the jconnect lib and allow you to pass in parameters etc. I recommend that you open up the java source and test it independently of java script until you get it connected correctly to your database. If you do get this working please post back here with what you needed to do.

Cheers Rod

rodhoward avatar Mar 19 '17 21:03 rodhoward

To anyone still having issues with this i fixed it by doing the following

  1. Add jconn4.jar to JavaSybaseLink/externalJars
  2. Update project.properties and replace file.reference.jconn3.jar=externalJars/jconn3.jar to file.reference.jconn4.jar=externalJars/jconn4.jar
  3. Update JavaSybaseLink/src/SybaseDB.java and replace references to com.sybase.jdbc3.jdbc.SybDriver; to jdbc4 com.sybase.jdbc4.jdbc.SybDriver;
  4. Rebuild the jar using apache ant via ant -buildfile build.xml

kyle-villegas avatar Aug 06 '19 08:08 kyle-villegas