Neo4j 2.0.0RC1 StartService失败87

Neo4j 2.0.0RC1 StartService失败87,neo4j,Neo4j,我刚下载了RC2。过去我运行1.9时没有任何问题。在Windows7上运行 下面是我安装时发生的情况。所有启动服务的尝试都失败,并显示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 sy

我刚下载了RC2。过去我运行1.9时没有任何问题。在Windows7上运行

下面是我安装时发生的情况。所有启动服务的尝试都失败,并显示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.
关于警告消息:安装程序似乎没有作为服务安装的选项,我也没有在手册中看到任何其他关于作为服务安装的说明


以下是我的发现

这里有一个注册表项: HKEY\U LOCAL\U MACHINE\SYSTEM\CurrentControlSet\services\u任何您指定的\u服务

图像路径有如下引号:

"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%

还有一个部分是在Neo4jInstaller.bat的第55行的javaPath中添加三个额外的引号来代替任何现有的引号

设置javaPath=%javaPath:“=”%

在GitHub上发现此问题,考虑到其他人对此问题的评论,不确定是否会解决此问题: Neo4j 2.0.0-RC1
neo4j-community-2.0.0-RC1-windows
视窗7

neo4j>bin\Neo4jInstaller.bat install

[SC] CreateService SUCCESS
[SC] StartService FAILED 87:
The parameter is incorrect.
此问题是由于新的Neo4j安装bat文件中的错误组合导致
Neo4jInstaller.bat
文件本身的
sc create service
命令中的
binPath=
参数损坏

具体来说,
sc create
命令要求引用此实例中的
binPath=
参数,因为Neo4j
%binPath%
变量中有嵌入空格。但是,在
Neo4jInstaller.bat
中创建的
sc create
命令在
%binPath%
变量定义中的
%javaPath%
变量中嵌入了未替换的引号和错误的空格

要解决此问题,需要编辑两个文件:

bin\functions.bat
bin\Neo4jInstaller.bat
%javaPath%
变量中嵌入的无效空格是由
functions.bat中
set javaPath=“%JAVA\u HOME%”
命令中“=”符号后的空格引起的

%binPath%
中未替换的引号需要在
Neo4jInstaller.bat
中进行三次更改:

  • 在将is嵌入
    %binPath%
    变量之前,必须删除
    %javaPath%
    变量中的引号
  • 整个
    %javaPath%\bin\java.exe
    路径必须包含在 引用
  • %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:"=\"%"
    


    在GitHub上有一个“已关闭”的Neo4j票证,该票证仅部分修复了RC2的这些问题。但是,在此期间,您必须自己解决此问题。

    因为这是谷歌搜索时弹出的第一个结果:“[SC]StartService FAILED 87:参数不正确。”

    再次检查路径。在大多数情况下,错误出现在引用的路径中

    我在使用.NET Core 2.0创建windows服务时遇到了这个问题

    路径示例:

    sc create YourServiceName binPath= "C:\Users\john\source\published\YourServiceName\YourServiceName.exe"
    
    我的错误是空间:

    sc create YourServiceName binPath= " C:\Users\john\source\published\YourServiceName\YourServiceName.exe"
    

    这可能是在系统注册表中看到的服务的ImagePath的某种缺陷,类似于其他一些windows服务问题:我有同样的问题,并找到了解决方法,感谢您如此彻底