rodhoward / node-sybase

23 stars 55 forks source link

Getting NPE after putting ENCRYPT_PASSWORD=true in sybaseConfig.properties #9

Open 6harat opened 7 years ago

6harat commented 7 years ago

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

rodhoward commented 7 years ago

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

kyle-villegas commented 5 years ago

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