neo4j-contrib / java-rest-binding

Java Bindings for the Neo4J Server REST API, providing an implementation of GraphDatabaseService
Other
120 stars 72 forks source link

When delete relationships using Batch API, server error message is not propagated #16

Open ceefour opened 12 years ago

ceefour commented 12 years ago

Client and server in different machines

Client:

Server:

15:22:20 [main] DEBUG i.c.b.m.a.RecreatePersonNodesFromLdap - Deleting 26 relationships: [5, 10, 3, 19, 7, 4, 16, 17, 22, 9, 18, 13, 1, 16, 11, 10, 8, 5, 20, 14, 11, 2, 21, 15, 12, 6]
Exception in thread "main" java.lang.RuntimeException: Error recreating Person nodes
        at id.co.bippo.mall.admin.RecreatePersonNodesFromLdap.run(RecreatePersonNodesFromLdap.java:205)
        at id.co.bippo.mall.admin.RecreatePersonNodesFromLdap.main(RecreatePersonNodesFromLdap.java:213)
Caused by: org.neo4j.rest.graphdb.RestResultException:  at
org.neo4j.server.rest.domain.BatchOperationFailedException: 
   org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:176)
   org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:131)
   sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   java.lang.reflect.Method.invoke(Method.java:601)
   com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
   com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
   com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
   com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
   com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
   com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
   com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
   com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
   com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
   com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
   com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
   com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
   com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
   com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
   org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
   org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
   org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
   org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
   org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
   org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
   org.mortbay.jetty.Server.handle(Server.java:326)
   org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
   org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
   org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
   org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
   org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
   org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
   org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

        at org.neo4j.rest.graphdb.RestAPI.convertRequestResultToEntities(RestAPI.java:232)
        at org.neo4j.rest.graphdb.RestAPI.executeBatch(RestAPI.java:194)
        at id.co.bippo.mall.admin.RecreatePersonNodesFromLdap.run(RecreatePersonNodesFromLdap.java:101)
        ... 1 more
ceefour commented 12 years ago

I found the issue from the server log: "Unable to delete relationship[16] since it is already deleted."

Problem is, the error message should be propagated to the Batch API client.

Jul 08, 2012 3:22:20 PM org.mortbay.log.Slf4jLog warn
SEVERE: /db/data/relationship/16/
java.lang.IllegalStateException: Unable to delete relationship[16] since it is already deleted.
        at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete(WriteTransaction.java:720)
        at org.neo4j.kernel.impl.persistence.PersistenceManager.relDelete(PersistenceManager.java:166)
        at org.neo4j.kernel.impl.core.NodeManager.deleteRelationship(NodeManager.java:990)
        at org.neo4j.kernel.impl.core.RelationshipImpl.delete(RelationshipImpl.java:145)
        at org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java:62)
        at org.neo4j.server.rest.web.DatabaseActions.deleteRelationship(DatabaseActions.java:612)
        at org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationship(RestfulGraphDatabase.java:442)
        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        at org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.neo4j.server.web.Jetty6WebServer.invokeDirectly(Jetty6WebServer.java:198)
        at org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:168)
        at org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:131)
        at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        at org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
vishal41190 commented 9 years ago

+1