如何使用neo4j解决运行时错误?

时间:2014-02-20 11:06:59

标签: macos nosql neo4j

我通过brew在mac上安装了neo4j,它安装了2.0.0版(稳定版)。

你在安装上看到的指示说我应该做四件事,第一件事只是

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home

neo4j start

但是失败并发出以下错误:

  

使用其他JVM参数:-server -XX:+ DisableExplicitGC   -Dorg.neo4j.server.properties = conf / neo4j-server.properties -Djava.util.logging.config.file = conf / logging.properties -Dlog4j.configuration = file:conf / log4j.properties -XX:+ UseConcMarkSweepGC - XX:+ CMSClassUnloadingEnabled -Dneo4j.ext.udc.source = homebrew -Djava.awt.headless = true启动Neo4j服务器...警告:不更改用户进程[32876] ...正在等待   服务器准备就绪..无法在120秒内启动。

在data / log / console.log中,我有以下内容

  

无法实例化[ch.qos.logback.classic.LoggerContext]   报告的异常:java.lang.InternalError:sun.net.PortConfig:   sun.net.PortConfig $ 1.run(PortConfig.java:59)at的未知操作系统   sun.net.PortConfig $ 1.run(PortConfig.java:45)at   java.security.AccessController.doPrivileged(Native Method)at   sun.net.PortConfig。(PortConfig.java:44)at   java.net.SocketPermission $ 1.run(SocketPermission.java:1217)at   java.net.SocketPermission $ 1.run(SocketPermission.java:1209)at   java.security.AccessController.doPrivileged(Native Method)at   java.net.SocketPermission.initEphemeralPorts(SocketPermission.java:1208)     在java.net.SocketPermission。(SocketPermission.java:235)at   sun.security.util.SecurityConstants。(SecurityConstants.java:259)     在   sun.security.provider.PolicyFile.getKnownInstance(PolicyFile.java:1023)     at sun.security.provider.PolicyFile.getInstance(PolicyFile.java:966)     在   sun.security.provider.PolicyFile.addGrantEntry(PolicyFile.java:862)     在sun.security.provider.PolicyFile.init(PolicyFile.java:651)at   sun.security.provider.PolicyFile.access $ 400(PolicyFile.java:283)at   sun.security.provider.PolicyFile $ 3.run(PolicyFile.java:587)at at   sun.security.provider.PolicyFile $ 3.run(PolicyFile.java:520)at at   java.security.AccessController.doPrivileged(Native Method)at   sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:519)     在   sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:505)     在sun.security.provider.PolicyFile.init(PolicyFile.java:464)at   sun.security.provider.PolicyFile。(PolicyFile.java:322)at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)     在   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)     在java.lang.Class.newInstance(Class.java:374)at   java.security.Policy.getPolicyNoCheck(Policy.java:195)at   java.security.ProtectionDomain.implies(ProtectionDomain.java:272)at   java.security.AccessControlContext.checkPermission(AccessControlContext.java:350)     在   java.security.AccessController.checkPermission(AccessController.java:559)     在ch.qos.logback.core.util.Loader $ 1.run(Loader.java:51)at   ch.qos.logback.core.util.Loader $ 1.run(Loader.java:48)at   java.security.AccessController.doPrivileged(Native Method)at   ch.qos.logback.core.util.Loader。(Loader.java:47)at   ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:117)     在   ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:146)     在org.slf4j.impl.StaticLoggerBinder.init(staticLoggerBinder.java:85)     在   org.slf4j.impl.StaticLoggerBinder。(StaticLoggerBinder.java:55)     在org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)at   org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)     at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)     在org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)at   org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)     在   org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)     在org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)     在   org.apache.commons.configuration.AbstractFileConfiguration。(AbstractFileConfiguration.java:121)     在   org.apache.commons.configuration.AbstractFileConfiguration。(AbstractFileConfiguration.java:154)     在   org.apache.commons.configuration.PropertiesConfiguration。(PropertiesConfiguration.java:252)     在   org.neo4j.server.configuration.PropertyFileConfigurator.loadPropertiesConfig(PropertyFileConfigurator.java:142)     在   org.neo4j.server.configuration.PropertyFileConfigurator。(PropertyFileConfigurator.java:76)     在   org.neo4j.server.Bootstrapper.createConfigurator(Bootstrapper.java:193)     在org.neo4j.server.Bootstrapper.start(Bootstrapper.java:84)at   org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50)异常   线程"主要" java.lang.NoClassDefFoundError:无法初始化   class ch.qos.logback.core.util.Loader at   ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:34)     在   ch.qos.logback.core.pattern.parser.Compiler.createConverter(Compiler.java:107)     在   ch.qos.logback.core.pattern.parser.Compiler.compile(Compiler.java:64)     在ch.qos.logback.core.pattern.parser.Parser.compile(Parser.java:91)     在   ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:86)     在   ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)     在   org.neo4j.server.logging.SimpleConsoleFormatter。(SimpleConsoleFormatter.java:52)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   方法)at   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)     在java.lang.Class.newInstance(Class.java:374)at   java.util.logging.LogManager.getFormatterProperty(LogManager.java:1341)     在java.util.logging.StreamHandler.configure(StreamHandler.java:76)     在java.util.logging.StreamHandler。(StreamHandler.java:94)at   java.util.logging.ConsoleHandler。(ConsoleHandler.java:88)at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)     在   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)     在java.lang.Class.newInstance(Class.java:374)at   java.util.logging.LogManager $ 4.run(LogManager.java:803)at   java.security.AccessController.doPrivileged(Native Method)at   java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:796)     在   java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1368)     在java.util.logging.LogManager.access $ 1500(LogManager.java:148)at   java.util.logging.LogManager中$ RootLogger.getHandlers(LogManager.java:1451)     在java.util.logging.Logger.log(Logger.java:609)at   java.util.logging.Logger.doLog(Logger.java:631)at   java.util.logging.Logger.log(Logger.java:654)at   org.neo4j.server.logging.Logger.log(Logger.java:60)at   org.neo4j.server.logging.Logger.info(Logger.java:91)at   org.neo4j.server.AbstractNeoServer.createInterruptStartupTimer(AbstractNeoServer.java:285)     在   org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:147)     在org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87)at   org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50)

我不知道发生了什么事。有人会帮我安装并运行这个东西吗?

2 个答案:

答案 0 :(得分:1)

如果您编辑

中的链接,则会发现此错误
/System/Library/Frameworks/JavaVM.framework/Versions

在Mac OS X上。但是你不应该这样做才能改变java版本(为了运行neo4j而需要)。

基本上,发生这种情况的原因是因为当我去安装neo4j时,我没有考虑brew,所以我下载了压缩文件并从网站解压缩。所以,当我得到它需要java 1.7的错误时,我当然安装了它,但我没想到改变JAVA_HOME。直到我完成了brew安装说明,我才得到了建议。所以基本上,软链接在java home的同时被更改了,我认为不知何故扔了neo4j。我只是删除了软链接,下载了apple java并安装了它,然后将java_home设置为指向最新的java。

答案 1 :(得分:0)

我得到了这个错误(当使用gradle来构建android应用程序时):

ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK

要解决这个问题,我解除了我的改变:

  1. 删除软链接(rm /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
  2. http://support.apple.com/kb/DL1572
  3. 再次安装apple java

    然后应用正确的更改: 将环境变量JAVA_HOME设置为新的java(export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home"