0

我正在使用 Neo4j 2.2.1 和 Spring Data Neo4j 4.0.0,我正在尝试导入类似时间树的图表(具有下一个、第一个、最后一个和子关系),但只有 2 个级别。我保存在根对象,我得到了以下异常(由于巨大的大小,我省略了异常中的大部分重复部分):

org.neo4j.ogm.session.result.ResultProcessingException: Failed to execute request: {"statements":[{"statement":"CREATE (_1:`Trace`{_1_props}), 
...
...
        at org.neo4j.ogm.session.request.DefaultRequest.execute(DefaultRequest.java:90)
        at org.neo4j.ogm.session.request.SessionRequestHandler.execute(SessionRequestHandler.java:94)
        at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:66)
        at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:375)
        at org.springframework.data.neo4j.repository.GraphRepositoryImpl.save(GraphRepositoryImpl.java:101)
        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:606)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:452)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:437)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:409)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy42.save(Unknown Source)
        at de.rwthaachen.service.core.EpisodeServiceImpl.loadEpisodeVersionDataTest(EpisodeServiceImpl.java:141)
        at sampleapp.EpisodeLauncher.main(EpisodeLauncher.java:70)
        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:606)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    Caused by: org.apache.http.client.HttpResponseException: Server Error
        at org.neo4j.ogm.session.request.DefaultRequest.execute(DefaultRequest.java:77)
        ... 27 more

这是我插入数据的函数:

public void loadEpisodeVersionDataTest(String projectName, Long timestampOfEpisodeVersion, LinkedHashSet<ExecutionRecord> executionRecords)
    {
        Long episodeNodeId = timeTreeService.getEpisodeVersionNodeId(projectName, timestampOfEpisodeVersion);
        EpisodeVersion episodeVersion = episodeVersionRepository.findOne(episodeNodeId);

        if(episodeVersion.getTraces() == null)
        {
            episodeVersion.contains(new LinkedHashSet<Trace>());
            Trace firstTrace = new Trace(0);
            episodeVersion.addTrace(firstTrace);
            episodeVersion.first(firstTrace);
            episodeVersion.last(firstTrace);
        }

        HashMap<String, Filter> filterMatchingStringToFilterMap = new HashMap<String, Filter>();
        for(Filter filter : filterRepository.getFiltersByFilterVersionChangeId(episodeVersion.getFilterVersionChange().getId()))
        {
            filterMatchingStringToFilterMap.put(filter.getMatchingString(), filter);
        }

        Iterator<ExecutionRecord> executionRecordIterator = executionRecords.iterator();
        ExecutionRecord previousExecutionRecord = episodeVersion.getLastTrace().getLastExecutionRecord();
        while(executionRecordIterator.hasNext())
        {
            ExecutionRecord executionRecord = executionRecordIterator.next();

            executionRecord.callerMappedOn(filterMatchingStringToFilterMap.get(executionRecord.getCallerFilterMatchingString()));
            executionRecord.calleeMappedOn(filterMatchingStringToFilterMap.get(executionRecord.getCalleeFilterMatchingString()));

            if(executionRecord.getTraceSequenceNumber() != episodeVersion.getLastTrace().getTraceSequenceNumber())
            {
                Trace newTrace = new Trace(executionRecord.getTraceSequenceNumber());
                newTrace.nextOf(episodeVersion.getLastTrace());
                episodeVersion.addTrace(newTrace);
                episodeVersion.last(newTrace);
            }

            if(episodeVersion.getLastTrace().getExecutionRecords() == null)
            {
                episodeVersion.getLastTrace().contains(new LinkedHashSet<ExecutionRecord>());
                episodeVersion.getLastTrace().first(executionRecord);
            }

            episodeVersion.getLastTrace().addExecutionRecord(executionRecord);
            executionRecord.nextOf(previousExecutionRecord);
            previousExecutionRecord = executionRecord;
            episodeVersion.getLastTrace().last(executionRecord);
        }

        episodeVersionRepository.save(episodeVersion);
    }

这个例外是什么意思?当我调试我的代码时,对象定义符合预期。提前感谢您,您的建议将不胜感激!

编辑

所以,我设法使之前的异常消失了。但现在我得到另一个例外,如下所示。

java.lang.OutOfMemoryError: Java heap space\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:366)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.matchers.MemoMismatchesMatcher.match(MemoMismatchesMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:39)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:39)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:72)\r\n\tat org.parboiled.parserunners.ReportingParseRunner.runBasicMatch(ReportingParseRunner.java:86)\r\n\tat org.parboiled.parserunners.ReportingParseRunner.run(ReportingParseRunner.java:66)\r\n\tat org.parboiled.scala.parserunners.ReportingParseRunner.run(ReportingParseRunner.scala:34)\r\n\tat org.neo4j.cypher.internal.compiler.v2_2.parser.Base$class.parseOrThrow(Base.scala:117)\r\n\tat org.neo4j.cypher.internal.compiler.v2_2.parser.CypherParser.parseOrThrow(CypherParser.scala:27)\r\n\tat org.neo4j.cypher.internal.compiler.v2_2.parser.CypherParser.parse(CypherParser.scala:34)\r\n\tat org.neo4j.cypher.internal.compiler.v2_2.CypherCompiler.prepareQuery(CypherCompiler.scala:126)\r\n\tat org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$$anon$2$$anonfun$3.apply(CompatibilityFor2_2.scala:154)\r\n\tat org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$$anon$2$$anonfun$3.apply(CompatibilityFor2_2.scala:154)\r\n\tat scala.util.Try$.apply(Try.scala:161)\r\n\tat org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$$anon$2.<init>(CompatibilityFor2_2.scala:154)\r\n\tat org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$class.produceParsedQuery(CompatibilityFor2_2.scala:153)\r\n\tat org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2Cost.produceParsedQuery(CompatibilityFor2_2.scala:326)\r\n\tat org.neo4j.cypher.internal.CypherCompiler.parseQuery(CypherCompiler.scala:81)\r\n\tat org.neo4j.cypher.ExecutionEngine$$anonfun$org$neo4j$cypher$ExecutionEngine$$parsePreParsedQuery$1.apply(ExecutionEngine.scala:116)\r\n\tat org.neo4j.cypher.ExecutionEngine$$anonfun$org$neo4j$cypher$ExecutionEngine$$parsePreParsedQuery$1.apply(ExecutionEngine.scala:116)\r\n\tat org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:34)\r\n\tat org.neo4j.cypher.ExecutionEngine.org$neo4j$cypher$ExecutionEngine$$parsePreParsedQuery(ExecutionEngine.scala:116)\r\n\tat org.neo4j.cypher.ExecutionEngine.parseQuery(ExecutionEngine.scala:112)\r\n\tat org.neo4j.cypher.internal.ServerExecutionEngine.isPeriodicCommit(ServerExecutionEngine.scala:34)\r\n\tat org.neo4j.cypher.javacompat.internal.ServerExecutionEngine.isPeriodicCommit(ServerExecutionEngine.java:72)\r\n\tat org.neo4j.server.rest.transactional.TransactionHandle.selectExecutionStrategy(TransactionHandle.java:189)\r\n\tat org.neo4j.server.rest.transactional.TransactionHandle.commit(TransactionHandle.java:133)\r\n\tat org.neo4j.server.rest.web.TransactionalService$2.write(TransactionalService.java:211)\r\n\tat com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)\r\n\tat com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)\r\n\tat com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)\r\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)\r\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)\r\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.neo4j.server.rest.dbms.AuthorizationFilter.doFilter(AuthorizationFilter.java:120)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)\r\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:620)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.OutOfMemoryError: Java heap space\r\n\tat java.util.HashMap.resize(HashMap.java:580)\r\n\tat java.util.HashMap.addEntry(HashMap.java:879)\r\n\tat java.util.HashMap.put(HashMap.java:505)\r\n\tat java.util.HashSet.add(HashSet.java:217)\r\n\tat org.parboiled.MatcherContext.memoizeMismatch(MatcherContext.java:312)\r\n\tat org.parboiled.matchers.MemoMismatchesMatcher.match(MemoMismatchesMatcher.java:44)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.matchers.MemoMismatchesMatcher.match(MemoMismatchesMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n\tat org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)\r\n\tat org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)\r\n\tat org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)\r\n"}]}
    at org.neo4j.ogm.session.response.JsonResponse.parseErrors(JsonResponse.java:132)
    at org.neo4j.ogm.session.response.JsonResponse.parseColumns(JsonResponse.java:109)
    at org.neo4j.ogm.session.response.JsonResponse.initialiseScan(JsonResponse.java:53)
    at org.neo4j.ogm.session.response.RowModelResponse.initialiseScan(RowModelResponse.java:60)
    at org.neo4j.ogm.session.response.RowModelResponse.<init>(RowModelResponse.java:34)
    at org.neo4j.ogm.session.response.SessionResponseHandler.updateObjects(SessionResponseHandler.java:77)
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:67)
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:41)
    at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:370)
    at org.springframework.data.neo4j.repository.GraphRepositoryImpl.save(GraphRepositoryImpl.java:46)
    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:606)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:452)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:437)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:409)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
    at com.sun.proxy.$Proxy42.save(Unknown Source)
    at de.rwthaachen.service.core.EpisodeServiceImpl.loadEpisodeVersionDataTest(EpisodeServiceImpl.java:141148)
    at sampleapp.EpisodeLauncher.main(EpisodeLauncher.java:70)
    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:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.apache.http.client.HttpResponseException: Server Error
    at org.neo4j.ogm.session.request.DefaultRequest.execute(DefaultRequest.java:77)
    ... 27 more
4

3 回答 3

2

SDN 4 并不是真正打算用于将您的对象批量导入 Neo4j。它是一个用于通用 Java 应用程序的对象图映射框架,而不是一个批处理导入器(它带来了自己的特定问题集)。支持 SDN 预期用例的一些设计决策与您尝试设计专门构建的 ETL 时的做法相反。我们还受到 Neo4j 的 HTTP Transactional 端点的性能的限制,尽管从绝对意义上来说并不慢,但也无法与 Batch Inserter 竞争。

我们将在未来对性能进行一些改进,当 Neo4j 的新二进制协议(2.3)发布时,我们将把它作为我们的传输协议插入。我们希望这可以将进出数据库的传输速度提高至少一个数量级。但是,请不要指望这些更改会从根本上改变 SDN 4 的行为特征。虽然未来的版本可能能够比现在更快地加载几千个节点,但它仍然不是 ETL 工具,而且我没想到它会被这样使用。

于 2015-06-03T11:00:07.233 回答
1

如果您受到内存的限制,那么定期保存会有所帮助,因为 SDN 4 会保留已更改的内容。您看到的多个提交是一个正在运行的事务的一部分。

在 LinkedHashSet 问题上,使用这样的Set接口

 Set<Foo> x = new LinkedHashSet<();
 ...
 public Set<Foo> getX() {}

应该管用。

于 2015-06-02T12:07:12.720 回答
0

经过几个小时的反复试验,最后我发现我需要限制我的保存深度级别。

以前,我没有指定深度级别,并且保存的对象越来越大,因为它的子对象的插入也同时运行。所以,在每个保存方法的深度为 1 之后,我终于摆脱了 StackOverFlow 错误。而且,通过不定期保存(我将所有对象放在一个 ArrayList 中并在最后保存它们),我在导入 ca. 1000 个节点(有关系)。

尽管如此,性能仍然不能令人满意,因为我可以在不到 1 分钟的时间内导入超过 60,000 个数据,因为我之前的 MongoDB 实现。我不知道这是否是因为 SDN4 以及嵌入式 API 是否可以更快。我真的很好奇是否有人对 SDN4 和嵌入式 API 进行了任何基准测试。

于 2015-06-03T00:14:44.970 回答