Copy pasted your code and I get this error 
Exception in thread "main" 
com.orientechnologies.orient.core.exception.OSerializationException: 
Impossible serialize value of type class org.json.JSONObject with the 
ODocument binary serializer
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.serialize(ORecordSerializerBinaryV0.java:257)
    at 
com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.toStream(ORecordSerializerBinary.java:104)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:2105)
    at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:714)
    at 
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitEntry(OAbstractPaginatedStorage.java:1939)
    at 
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:922)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:488)
    at 
com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:147)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2427)
    at 
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2397)
    at 
com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.executeOutsideTx(OrientBaseGraph.java:1705)
    at 
com.tinkerpop.blueprints.impls.orient.OrientElement.checkForClassInSchema(OrientElement.java:617)
    at 
com.tinkerpop.blueprints.impls.orient.OrientEdge.getClassName(OrientEdge.java:531)
    at 
com.tinkerpop.blueprints.impls.orient.OrientEdge.createDocument(OrientEdge.java:568)
    at 
com.tinkerpop.blueprints.impls.orient.OrientEdge.<init>(OrientEdge.java:76)
    at 
com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge(OrientVertex.java:935)
    at 
com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.addEdge(OrientBaseGraph.java:685)
    at odb.vedge.main(vedge.java:35)
Jun 08, 2015 6:36:30 PM com.orientechnologies.common.log.OLogManager log
INFO: - closing storage: tinkerpop...


On Monday, 8 June 2015 18:29:15 UTC+5:30, [email protected] wrote:
>
> Hi,
> i have tried this code and it seems to work
>
> OrientGraph graph = new OrientGraph("memory:test");
>     
>      Data data = new Data();
>      data.setNome("New Data");
>      data.addData("a","b","c");
>     
>      JSONObject json=new JSONObject();
>      json.put("data", data);
>      
>      Vertex first = graph.addVertex(null);
>      first.setProperty("name","anything");
>      first.setProperty("allprop",json);
>      
>      Vertex second = graph.addVertex(null);
>      second.setProperty( "name", "Marko" );
>      
>      Edge lucaKnowsMarko = graph.addEdge(null, first, second, "relation");
>
> Bye, Alessandro.
>

-- 

--- 
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.

Reply via email to