I posted this question on stack overflow too:
http://stackoverflow.com/questions/25141511/neo4j-cypher-results-as-json-getting-jsonmappingexception-when-using-jsonhelper
Regards,
On 05-08-14 15:31, Rubin wrote:
> Hi Neo4j,
>
> Me and my team are working on neo4vertx, a module that makes it possible
> to talk to a Neo4j database using Vert.x.
>
> We are implementing a feature called "query" which allows a Vert.x user
> to send a Cypher query as an eventbus message and get a JSON resultset
> back.
>
> However, we seem to run into an unexpected problem when serializing to
> JSON using JsonHelper.createJsonFrom() with certain queries.
>
> A quick example (database has stuff in it of course):
>
> // Fails with JsonMappingException (see below):
> "MATCH (n) RETURN n"
>
> //Succeeds:
> "MATCH (n) RETURN n.something"
>
> //Rest of code:
> engine = new ExecutionEngine(graphDatabaseService);
> ExecutionResult result;
> result = engine.execute(query);
>
> Object object = result.iterator();
> String foo = JsonHelper.createJsonFrom(object);
> System.out.println("DEBUG (foo): " + foo);
>
>
> Does this look familiar to anyone? We essentially want to be able to
> send any kind of query and either return an empty json string or a json
> representation not unlike the result.json that you can retrieve from the
> web interface of neo4j!
>
>
> The Exception:
> testQuery(org.openpcf.neo4vertx.neo4j.Neo4jGraphTest) Time elapsed:
> 2.362 sec <<< ERROR!
> org.neo4j.server.rest.domain.JsonBuildRuntimeException:
> org.codehaus.jackson.map.JsonMappingException: No serializer found for
> class
> org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl
> and no properties discovered to create BeanSerializer (to avoid
> exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) )
> (through reference chain:
> scala.collection.convert.MapWrapper["content"]->org.neo4j.kernel.impl.core.NodeProxy["graphDatabase"]->org.neo4j.test.["dependencyResolver"])
> at
> org.codehaus.jackson.map.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:52)
> at
> org.codehaus.jackson.map.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:25)
> at
> org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:446)
> at
> org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
> at
> org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:112)
> at
> org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:446)
> at
> org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
> at
> org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:112)
> at
> org.codehaus.jackson.map.ser.std.MapSerializer.serializeFields(MapSerializer.java:262)
> at
> org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:186)
> at
> org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:23)
> at
> org.codehaus.jackson.map.ser.std.StdContainerSerializers$IteratorSerializer.serializeContents(StdContainerSerializers.java:234)
> at
> org.codehaus.jackson.map.ser.std.StdContainerSerializers$IteratorSerializer.serializeContents(StdContainerSerializers.java:195)
> at
> org.codehaus.jackson.map.ser.std.AsArraySerializerBase.serialize(AsArraySerializerBase.java:86)
> at
> org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
> at
> org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
> at
> org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1613)
> at
> org.neo4j.server.rest.domain.JsonHelper.createJsonFrom(JsonHelper.java:108)
> at org.openpcf.neo4vertx.neo4j.Neo4jGraph.query(Neo4jGraph.java:132)
> at
> org.openpcf.neo4vertx.neo4j.Neo4jGraphTest.testQuery(Neo4jGraphTest.java:47)
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" 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.