Neo4j问题汇总

1. Neo4j start失败问题

1.1 问题表现

主要是在PowerShell中输入neo4j start之后系统提示neo4j started,访问http://localhost:7474/browser/时提示连接不上。
然后查看任务管理器中发现Neo4j服务被强停,重新打开之后依旧被自动停止。
在PowerShell中输入neo4j.bat console发现了如下错误:

INFO  ======== Neo4j 3.5.7 ========
INFO  Starting...
ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@15723761' was successfully initialized, but failed to start. Please see the attached cause exception "apoc/scoring/Scoring has been compiled
by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@15723761' was successfully initialized, but failed to start. Please see the attached cause exception "apoc/scoring/Scoring has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@15723761' was successfully initialized, but failed to start. Please see the attached cause exception "apoc/scoring/Scoring has been compiled by a more recent
version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0".
  at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:45)
  at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:187)
  at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:124)
  at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:91)
  at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@15723761' was successfully initialized, but failed to start. Please see the attached cause exception "apoc/scoring/Scoring has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0".
  at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
  at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:180)
  ... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, D:\Neo4J\neo4j-community-3.5.7\data\databases
  at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:230)
  at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:146)
  at org.neo4j.server.database.CommunityGraphFactory.newGraphDatabase(CommunityGraphFactory.java:41)
  at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:90)
  at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)        ... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.proc.Procedures@31ff1390' was successfully initialized, but failed to start. Please see the attached cause exception "apoc/scoring/Scoring has been compiled by a more recent version of the Java
Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file
versions up to 52.0".
  at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
  at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:225)
Caused by: java.lang.UnsupportedClassVersionError: apoc/scoring/Scoring has been compiled by a
time only recognizes class file versions up to 52.0
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at org.neo4j.kernel.impl.proc.ProcedureJarLoader$1.fetchNextOrNull(ProcedureJarLoader.java:161)
  at org.neo4j.kernel.impl.proc.ProcedureJarLoader$1.fetchNextOrNull(ProcedureJarLoader.java:138)
  at org.neo4j.collection.PrefetchingRawIterator.peek(PrefetchingRawIterator.java:50)
  at org.neo4j.collection.PrefetchingRawIterator.hasNext(PrefetchingRawIterator.java:36)
  at org.neo4j.kernel.impl.proc.ProcedureJarLoader.loadProcedures(ProcedureJarLoader.java:111)
  at org.neo4j.kernel.impl.proc.ProcedureJarLoader.loadProceduresFromDir(ProcedureJarLoader.java:85)
  at org.neo4j.kernel.impl.proc.Procedures.start(Procedures.java:323)
  at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)        ... 11 more
INFO  Neo4j Server shutdown initiated by request

1.2 解决方法

将$NEO4J_HOME/plugins中的APOC插件降低版本。

1.3 问题原因

原因显而易见,错误中提示:

Please see the attached cause exception "apoc/scoring/Scoring has been compiled by a more recent
version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0"

我用的APOC插件是被高版本Java(55.0)编译出来的,而当前Java最多只支持到52.0,所以需要降低APOC的版本,需要的可以从neo4j-contrib/neo4j-apoc-procedures中下载对应的版本。

这个问题正如Neo4j社区这篇帖子dana.canzano所讲,this may be due to a invalid APOC version in $NEO4J_HOME/plugins.

我刚开始没有看错误提示就Google的时候也发现了其他对类似问题的描述。

方法一:这里面主要针对的是**Component **** was successfully initialized, but failed to start.**描述的问题,Neo4j已经成功初始化,但是在启动失败。可能是neo4j自身的bug?只允许在本机中运行一个数据库。有待进一步了解。解决方法按照这篇博客评论区的方法,把%NEO4J_HOME%\data\databases里面的所有文件都删除掉,然后再运行即可。
方法二解决的问题:neo4j的Github issue中描述的那样,APOC 使用Neo4j内部内核扩展 API。假定这种扩展对数据库的安全和正确操作至关重要,就会因为加载而提示失败。可能后面使用APOC操作时会碰到。

2. neo4j-import csv时,源数据存在换行问题

2.1 问题描述

使用neo4j-import导入数据时提示:

Multi-line fields are illegal in this context and so this might suggest that there’s a field with a start quote, but a missing end quote.

2.2 解决方法

将命令修改为

neo4j-admin import --multiline-fields=true --nodes entity.csv  --relationships relationship.csv
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
问题: http://localhost:63040/content/swagger-ui.html打不开,该如何解决? 回答: 根据你提供的引用内容,有几种可能的解决方法。首先,你可以检查是否存在/typography.css文件,因为它可能是导致http://localhost:8080/swagger-ui.html无法显示的原因。如果该文件确实不存在,你可以尝试通过添加该文件或修复文件路径来解决此问题。\[1\] 另外,你还可以尝试使用代码来打开浏览器并访问Swagger UI页面。你可以在你的应用程序中添加一个类似于下面的代码段,其中的url变量应该是Swagger UI的URL链接: @Configuration public class XxxApplication { @EventListener({ApplicationReadyEvent.class}) public void ready() { System.out.println("Application is almost started ... opening the browser"); String url = "http://localhost:8080/swagger-ui.html"; Runtime runtime = Runtime.getRuntime(); try { runtime.exec("rundll32 url.dll,FileProtocolHandler " + url); } catch (IOException e) { e.printStackTrace(); } } }\[2\] 另外一种方法是在你的项目中添加一个默认的控制器,将根路径("/")重定向到index.html页面。你可以使用类似于下面的代码来实现这个功能: @Controller @RequestMapping("/") public class DefaultController { @RequestMapping("/") public String index() { return "forward:index.html"; } }\[3\] 希望这些方法能够帮助你解决问题。 #### 引用[.reference_title] - *1* [Empty /swagger-ui.html - 404 /typography.css](https://blog.csdn.net/weixin_39562234/article/details/118172901)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [- 如何访问localhost:8080直接打开swagger-ui界面](https://blog.csdn.net/Sora_Xu/article/details/106436231)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值