NotSerializableException while running OrientDB as Windows service

54 views
Skip to first unread message

Gregory Zhukovsky

unread,
Jul 28, 2016, 9:10:44 AM7/28/16
to OrientDB
Hello,

I run OrientDB 2.1.11 as  a service on Windows server 2012;
It's used to parse combinations of public transportation paths. Parsing is made by server side JS function.
It was ok for some time, but it's been two weeks that the service is throwing a same exception, few times a minute:

Cannot serialize an exception object
java.io.NotSerializableException: jdk.nashorn.api.scripting.ScriptObjectMirror
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
at java.lang.Throwable.writeObject(Throwable.java:985)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
at java.lang.Throwable.writeObject(Throwable.java:985)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.serializeExceptionObject(ONetworkProtocolBinary.java:2035)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sendError(ONetworkProtocolBinary.java:868)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.sendErrorOrDropConnection(OBinaryNetworkProtocolAbstract.java:261)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:236)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)

Sometimes it leads to server crash (I see in logs, that the service started, but don't see the shutdown, server itself did not reboot and did not run some scheduled tasks that could close the service).

No one touched neither the parsing function nor the DB structure.
Tried to rebuild the indices, as one of the log records said - with no effect on the issue.
When I change the function name (so the web app looses the access to it) - exceptions stop. The function still continues to work fine - when the server is up, i can execute searches, and it returns the correct results. 

Googling the issue doesn't push up something relevant.. have someone here issued issues like that?  What is the best way to investigate the problem?

Gregory Zhukovsky

unread,
Aug 8, 2016, 3:40:41 AM8/8/16
to OrientDB
For everyone who is googling it as I was:
The problem was at my server-side javascript function. In some cases it tried to call the array member that did not exist, and then it threw the above exception and been terminated.

P.S.: debugging the embedded server-side JS functions in OrientDB is a little bit nightmare. Although, it's a great feature :)
Reply all
Reply to author
Forward
0 new messages