2013-11-22 50 views
1

我刚刚下载了RC2。过去我没有遇到1.9的问题。在Windows 7上运行。Neo4j 2.0.0RC1 StartService失败87

以下是我安装时发生的情况。所有尝试启动服务都会失败,并显示87错误消息。

C:\Neo4j\Neo4JTest\neo4j-community-2.0.0-RC1\bin>Neo4jInstaller.bat install 
"WARNING: this installer is deprecated and may not be the optimal way to install Neo4j on your system." 
"Please see the Neo4j Manual for up to date information on installing Neo4j." 
Press any key to continue 
[SC] CreateService SUCCESS 
[SC] StartService FAILED 87: 

The parameter is incorrect. 

关于警告消息:安装程序似乎不具备安装作为服务的选项,我还没有看到手册中的任何其他说明安装为服务。

http://docs.neo4j.org/chunked/2.0.0-RC1/server-installation.html#windows-install

+0

这可能是一些类似于其他Windows服务问题的系统注册表中的服务ImagePath的错误类型:http://synergy-foss.org/spit/issues/details/3763/? lang = de – LameCoder

+2

我有同样的问题,发现一个解决方法http://stackoverflow.com/questions/20174409/neo4j-2-0-0-rc1-unable-to-install-as-windows-service – Flip

回答

1

的Neo4j 2.0.0-RC1
的Neo4j社区-2.0.0-RC1窗口
的Windo WS 7

neo4j>bin\Neo4jInstaller.bat install 

[SC] CreateService SUCCESS 
[SC] StartService FAILED 87: 
The parameter is incorrect. 

这个问题在导致在Neo4jInstaller.bat文件本身sc create service命令腐败binPath=参数的新的Neo4j安装.bat文件错误的组合的结果。

具体而言,sc create命令需要在此实例中引用binPath=参数,因为Neo4j %binPath%变量中存在嵌入空格。但是,在Neo4jInstaller.bat内创建的sc create命令包含未转义的引号和嵌入在%binPath%变量定义中的%javaPath%变量中的错误空间。

为了解决这个问题,两个文件需要被编辑:

bin\functions.bat 
bin\Neo4jInstaller.bat 

嵌入在%javaPath%变量的无效空间,通过在该functions.bat“=”,在set javaPath="%JAVA_HOME%"命令符号后的空间造成的。

%binPath%的转义引号需要Neo4jInstaller.bat三个转变:

  1. %javaPath%变量的报价之前必须被移除嵌入在%binPath%变量。
  2. 整个%javaPath%\bin\java.exe路径必须包含在 引号中。
  3. %binPath%变量值必须用引号括起来,并且嵌入在%binPath%变量中的 引号必须转义。

另外,内Neo4jInstaller.bat调用functions.bat必须被修改,因为functions.bat驻留在\bin子目录,Neo4jInstaller.bat必须从根neo4j路径运行。

functions.bat 
============= 
:findJavaHome 
    if not "%JAVA_HOME%" == "" (

    if exist "%JAVA_HOME%\bin\javac.exe" (
rem  set javaPath= "%JAVA_HOME%\jre" 
     set javaPath="%JAVA_HOME%\jre" 
     goto:eof 
    ) 

rem set javaPath= "%JAVA_HOME%" 
    set javaPath="%JAVA_HOME%" 
    goto:eof 
) 


Neo4jInstaller.bat 
================== 

rem call functions.bat :findJavaHome 
rem set javaPath=%javaPath:"="""% 

rem set binPath="%javaPath%\bin\java.exe %loggingProperties% -DworkingDir="%~dps0.." -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory="%~dps0..\data\log" -jar %~dps0%wrapperJarFilename% %serviceName%" 

    call %~dps0functions.bat :findJavaHome 
    set javaPath=%javaPath:"=% 

    set binPath="%javaPath%\bin\java.exe" %loggingProperties% -DworkingDir="%~dps0.." -DconfigFile=%configFile% %classpath% %mainclass% -Dorg.neo4j.cluster.logdirectory="%~dps0..\data\log" -jar %~dps0%wrapperJarFilename% %serviceName% 

    set binPath="%binPath:"=\"%" 


有一个“封闭”的Neo4j在GitHub上的https://github.com/neo4j/neo4j/pull/1535票,只有部分修复了RC2这些问题。但是,在此期间,你将不得不自己解决这个问题。

+0

感谢您的存在如此彻底 – LameCoder

0

因此,这里是我发现的。

这里有一个注册表项: HKEY_LOCAL_MACHINE \系统\ CurrentControlSet \ services_whatever_you_named_the_service

图像路径有引号,像这样:

"C:\Program Files\Java\jdk1.7.0_21\jre"\bin\java.exe .... 

我现在去掉引号

C:\Program Files\Java\jdk1.7.0_21\jre\bin\java.exe .... 

它作品。

查看bat文件,它从我的JAVA_HOME env变量中找到javaPath,并在functions.bat中设置%javaPath%并用引号括起来。

再就是

set javaPath=%javaPath:"="""%

发现这对GitHub的是对线55添加替代任何现有报价的三个额外的报价在javaPath Neo4jInstaller.bat的一部分,不知道这是否是怎么回事解决此问题的考虑有关问题,别人的评论: https://github.com/neo4j/neo4j/pull/1535