I have been having problems saving data to the DB since I updated from 1.3
to 1.7-rc2.
I am getting this error whenever I'm saving a record : Caused by:
com.orientechnologies.orient.core.exception.OValidationException: The field
'TestClass2.testClass1Property' has been declared as EMBEDDED with linked
class 'TestClass1' but the record has no class
(Will include full stacktrace at the end of the post)
Here's a small test case to easily reproduce the problem :
*Script used to create the DB* : console.bat CREATE DATABASE
plocal:../databases/TESTDB admin admin plocal;
*Code to reproduce the problem : *
final ODatabaseDocumentTx db = new
ODatabaseDocumentTx("remote:localhost/TESTDB").open("admin", "admin");
final OSchema schema = db.getMetadata().getSchema();
final String SUFFIX = "TESTCLUSTER1";
ODatabaseRecordThreadLocal.INSTANCE.set(db);
db.declareIntent(new OIntentMassiveInsert());
OClass testClass1 = schema.createClass("TestClass1");
OClass testClass2 = schema.createClass("TestClass2");
OClass testClass3 = schema.createClass("TestClass3");
testClass2.createProperty("testClass1Property", OType.EMBEDDED, testClass1);
int clusterId;
clusterId = db.addCluster("TestClass1" + SUFFIX, CLUSTER_TYPE.PHYSICAL);
schema.getClass("TestClass1").addClusterId(clusterId);
clusterId = db.addCluster("TestClass2" + SUFFIX, CLUSTER_TYPE.PHYSICAL);
schema.getClass("TestClass2").addClusterId(clusterId);
//Reassign Classes because I just added clusters
testClass1 = schema.getClass("TestClass1");
testClass2 = schema.getClass("TestClass2");
ODocument testClass2Document = new ODocument(testClass2);
testClass2Document.field("testClass1Property", new ODocument(testClass1));
testClass2Document.save("TestClass2" + SUFFIX);
db.commit();
db.close();
*Things to note : *
* - *Whenever I comment out this line, I dont get an error. :
OClass testClass3 = schema.createClass("TestClass3");
- I am running 1.7-rc2 version of orientdb.
- Didn't get this error in 1.3 version ( Probably because
https://github.com/orientechnologies/orientdb/commit/b0f873dbcbedafd91cf13f996640c918eb202292
wasn't implemented until 1.6 )
- Full Stack Trace included in attachments.
Thanks !
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
Exception in thread "AWT-EventQueue-0" java.security.PrivilegedActionException:
java.security.PrivilegedActionException:
java.util.concurrent.ExecutionException:
java.lang.reflect.InvocationTargetException
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.security.PrivilegedActionException:
java.util.concurrent.ExecutionException:
java.lang.reflect.InvocationTargetException
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
... 9 more
Caused by: java.util.concurrent.ExecutionException:
java.lang.reflect.InvocationTargetException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at
com.netappsid.ejb3.naming.StatelessMethodHandler.invoke(StatelessMethodHandler.java:48)
at
com.netappsid.remote.services.beans.OrientServicesBean_$$_javassist_121.createSchemaClasses(OrientServicesBean_$$_javassist_121.java)
at com.netappsid.remote.action.DerbyOrient.doAction(DerbyOrient.java:29)
at
com.netappsid.action.AbstractAction.actionPerformed(AbstractAction.java:109)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at
com.netappsid.gui.components.ActionButton.fireActionPerformed(ActionButton.java:216)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at
com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
com.netappsid.ejb3.internal.InvocationHandler$InvocationContextImpl.proceed(InvocationHandler.java:97)
at
com.netappsid.ejb3.internal.InvocationHandler.call(InvocationHandler.java:164)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by:
com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException:
Exception during response processing.
at
com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:264)
at
com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:231)
at
com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:202)
at
com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:113)
at
com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1951)
at
com.orientechnologies.orient.client.remote.OStorageRemote.createRecord(OStorageRemote.java:367)
at
com.orientechnologies.orient.client.remote.OStorageRemoteThread.createRecord(OStorageRemoteThread.java:236)
at
com.orientechnologies.orient.core.db.raw.ODatabaseRaw.save(ODatabaseRaw.java:268)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:885)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:78)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:274)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:39)
at
com.orientechnologies.orient.core.record.ORecordAbstract.save(ORecordAbstract.java:329)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1375)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1358)
at
com.netappsid.remote.services.beans.OrientServicesBean.createSchemaClasses(OrientServicesBean.java:46)
... 11 more
Caused by: com.orientechnologies.orient.core.exception.OValidationException:
The field 'TestClass2.testClass1Property' has been declared as EMBEDDED with
linked class 'TestClass1' but the record has no class
at
com.orientechnologies.orient.core.record.ORecordSchemaAwareAbstract.validateEmbedded(ORecordSchemaAwareAbstract.java:447)
at
com.orientechnologies.orient.core.record.ORecordSchemaAwareAbstract.validateField(ORecordSchemaAwareAbstract.java:257)
at
com.orientechnologies.orient.core.record.ORecordSchemaAwareAbstract.validate(ORecordSchemaAwareAbstract.java:74)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:272)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:234)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:52)
at
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.createRecord(OBinaryNetworkProtocolAbstract.java:333)
at
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.createRecord(ONetworkProtocolBinary.java:1484)
at
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:289)
at
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:126)
at
com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:45)