Hi,
i am having a problem with res.send() in decaf/modules/http/lib/Response.js
So far, everything worked, while ive been requesting files and some very simple json-data (like a login request returning if the user/password combination is valid).
Now i tried requesting/returning some data from the database (simple stuff - id (Objectid), username and language-code)
and i get an internal server error.
After about 2-3 hours of searching, i found out that the problem is the ObjectId - as soon as it is in the data that is being sent, the error happens, if i dont send it, no error.
the stacktrace:
Stack Trace
InternalError: Java class "[Ljava.lang.reflect.Constructor;" has no public instance field or method named "toJSON". (/usr/local/decaf/modules/http/lib/Response.js#185)
at /usr/local/decaf/modules/http/lib/Response.js:178 (anonymous)
at /opt/itk/modules/UserHandler.js:38 (anonymous)
at /opt/itk/modules/UserHandler.js:12 (anonymous)
at /opt/itk/libs/decaf-jolt/lib/Application.js:233 (anonymous)
at /opt/itk/libs/decaf-jolt/lib/Application.js:170 (anonymous)
at /usr/local/decaf/modules/http/lib/Child.js:69 (handleRequest)
at /usr/local/decaf/modules/http/lib/Child.js:102 (Child)
at /usr/local/decaf/modules/Threads/lib/Thread.js:197 (anonymous)
interestingly it shows the error happening in line 178 whereas, when i use the debugger, the error happens in line 182 of Response.js (which makes sense because i'm sending json-data, not text).
.
Please advise/help.