Adam Miller
Adam Miller

Reputation: 1783

How do I resolve runtime errors with neo4j?

I installed neo4j on mac through brew, which installed version 2.0.0 (stable).

The directions you see on installation say I should do four things, the first of which is just

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

And

neo4j start

But that fails and gives the following error:

Using additional JVM arguments: -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 Starting Neo4j Server...WARNING: not changing user process [32876]... waiting for server to be ready.. Failed to start within 120 seconds.

And in the data/log/console.log I have the following

Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.lang.InternalError: sun.net.PortConfig: unknown OS at 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) at java.net.SocketPermission.(SocketPermission.java:235) at sun.security.util.SecurityConstants.(SecurityConstants.java:259) at sun.security.provider.PolicyFile.getKnownInstance(PolicyFile.java:1023) at sun.security.provider.PolicyFile.getInstance(PolicyFile.java:966) at sun.security.provider.PolicyFile.addGrantEntry(PolicyFile.java:862) at 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 sun.security.provider.PolicyFile$3.run(PolicyFile.java:520) at java.security.AccessController.doPrivileged(Native Method) at sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:519) at sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:505) at sun.security.provider.PolicyFile.init(PolicyFile.java:464) at sun.security.provider.PolicyFile.(PolicyFile.java:322) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at 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) at java.security.AccessController.checkPermission(AccessController.java:559) at 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) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:146) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) at org.apache.commons.configuration.AbstractFileConfiguration.(AbstractFileConfiguration.java:121) at org.apache.commons.configuration.AbstractFileConfiguration.(AbstractFileConfiguration.java:154) at org.apache.commons.configuration.PropertiesConfiguration.(PropertiesConfiguration.java:252) at org.neo4j.server.configuration.PropertyFileConfigurator.loadPropertiesConfig(PropertyFileConfigurator.java:142) at org.neo4j.server.configuration.PropertyFileConfigurator.(PropertyFileConfigurator.java:76) at org.neo4j.server.Bootstrapper.createConfigurator(Bootstrapper.java:193) at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:84) at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50) Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class ch.qos.logback.core.util.Loader at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:34) at ch.qos.logback.core.pattern.parser.Compiler.createConverter(Compiler.java:107) at ch.qos.logback.core.pattern.parser.Compiler.compile(Compiler.java:64) at ch.qos.logback.core.pattern.parser.Parser.compile(Parser.java:91) at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:86) at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28) at org.neo4j.server.logging.SimpleConsoleFormatter.(SimpleConsoleFormatter.java:52) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:374) at java.util.logging.LogManager.getFormatterProperty(LogManager.java:1341) at java.util.logging.StreamHandler.configure(StreamHandler.java:76) at java.util.logging.StreamHandler.(StreamHandler.java:94) at java.util.logging.ConsoleHandler.(ConsoleHandler.java:88) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at 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) at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1368) at java.util.logging.LogManager.access$1500(LogManager.java:148) at java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:1451) at 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) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:147) at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87) at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:50)

I have no idea what is going on. Will someone help me get this thing installed and running?

Upvotes: 1

Views: 635

Answers (2)

Helin Wang
Helin Wang

Reputation: 4202

I got this error (when using gradle to build android application) by doing:

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

To fix this, I undid my change:

  1. remove the soft link (rm /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK)
  2. install apple java again from http://support.apple.com/kb/DL1572

And then apply the correct change: set environment variable JAVA_HOME to new java (export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home")

Upvotes: 0

Adam Miller
Adam Miller

Reputation: 1783

It turns out that you get this error if you edit the links within

/System/Library/Frameworks/JavaVM.framework/Versions

on Mac OS X. But you shouldn't do that in order to change the java version (which was needed in order to run neo4j).

Essentially, the reason this happened is because when I went to install neo4j, I didn't think about brew, so I downloaded the compressed file and unzipped from the site. So, when I got the error that it needed java 1.7, I of course installed it, but I didn't think to change JAVA_HOME. It wasn't until I went through the brew install instructions that I got the advice to do so. So basically, the soft links were changed at the same time as java home, which I think threw neo4j somehow. I simply removed the softlinks, downloaded the apple java and installed it, then set java_home to point to the latest java.

Upvotes: 1

Related Questions