2

jre 1.7 .0_67しかないターゲットマシンでprocrunを使用してjettyをサービスとして実行する問題に直面しています.JDKをインストールできず、マシンにJAVA_HOMEがありません.ここに私のスクリプトがあります:

@echo off
set SERVICE_NAME="Batch_Server"
set DISPLAY_NAME="Batch Server"
set DESCRIPTION="Batch Server"  
set STOPKEY=stopkey
set STOPPORT=50001

set JETTY_JAVA_HOME=%MYAPP_HOME%\jre

set JETTY_HOME=%JETTY_HOME%
set JETTY_BASE=%JETTY_HOME%

set PR_INSTALL=%JETTY_HOME%\service-config\Batch Server.exe
set PR_INSTALL_NEW="%JETTY_HOME%\service-config\Batch Server.exe"

@REM Service Log Configuration  
set PR_LOGPREFIX=%SERVICE_NAME%
set PR_LOGPATH=%JETTY_HOME%\logs\service_logs
set PR_STDOUTPUT=auto
set PR_STDERROR=auto
set PR_LOGLEVEL=Debug

@REM Path to Java Installation
set PR_JVM=%JETTY_JAVA_HOME%\bin\server\jvm.dll


set PR_CLASSPATH=%JETTY_HOME%\start.jar

@REM JVM Configuration
set PR_JVMMS=2048
set PR_JVMMX=3072


set PR_JVMOPTIONS=-Duser.dir="%JETTY_BASE%";-Djetty.home="%JETTY_HOME%";-        Djetty.base="%JETTY_BASE%"
set PR_JVMOPTIONS=%PR_JVMOPTIONS%;-XX:+PrintGCDetails;-    XX:+PrintGCDateStamps;-XX:+UseGCLogFileRotation;-XX:+HeapDumpOnOutOfMemoryError
set PR_JVMOPTIONS=%PR_JVMOPTIONS%;-XX:NumberOfGCLogFiles=5;-XX:GCLogFileSize=100M;-Xloggc:%JETTY_HOME%/logs/jetty.gc;


@REM Startup Configuration
set JETTY_START_CLASS=org.eclipse.jetty.start.Main

set PR_STARTUP=auto
set PR_STARTMODE=jvm
set PR_STARTCLASS=%JETTY_START_CLASS%
set PR_STARTPARAMS=STOP.KEY="%STOPKEY%";STOP.PORT=%STOPPORT%

@REM Shutdown Configuration
set PR_STOPMODE=jvm
set PR_STOPCLASS=%JETTY_START_CLASS%
set PR_STOPPARAMS=--    stop;STOP.KEY="%STOPKEY%";STOP.PORT=%STOPPORT%;STOP.WAIT=10

REM %~1 removing any surrounding quotes (")
%~1%PR_INSTALL_NEW% //IS/%SERVICE_NAME% ^
  --DisplayName=%DISPLAY_NAME% ^
  --Description=%DESCRIPTION% ^
  --Install="%PR_INSTALL%" ^
  --Startup="%PR_STARTUP%" ^
  --LogPath="%PR_LOGPATH%" ^
  --LogPrefix="%PR_LOGPREFIX%" ^
  --LogLevel="%PR_LOGLEVEL%" ^
  --StdOutput="%PR_STDOUTPUT%" ^
  --StdError="%PR_STDERROR%" ^
  --Jvm="%PR_JVM%" ^
  --JvmMs="%PR_JVMMS%" ^
  --JvmMx="%PR_JVMMX%" ^
  --JvmOptions="%PR_JVMOPTIONS%" ^
  --Classpath="%PR_CLASSPATH%" ^
  --StartMode="%PR_STARTMODE%" ^
  --StartClass="%JETTY_START_CLASS%" ^
  --StartParams="%PR_STARTPARAMS%" ^
  --StopMode="%PR_STOPMODE%" ^
  --StopClass="%PR_STOPCLASS%" ^
  --StopParams="%PR_STOPPARAMS%"

if not errorlevel 1 goto installed
echo Failed to install %SERVICE_NAME% service.  Refer to log in %PR_LOGPATH%
goto end

:installed
echo The Service %SERVICE_NAME% has been installed

:end

エラーが発生しています:

2015-01-18 18:05:22 Commons Daemon procrun stderr initialized
java.lang.ExceptionInInitializerError
    at java.nio.file.FileSystems.getDefault(Unknown Source)
    at org.eclipse.jetty.start.FS.toPath(FS.java:153)
    at org.eclipse.jetty.start.config.CommandLineConfigSource.findJettyHomePath(CommandLineConfigSource.java:103)
    at org.eclipse.jetty.start.config.CommandLineConfigSource.<init>(CommandLineConfigSource.java:60)
    at org.eclipse.jetty.start.Main.processCommandLine(Main.java:589)
    at org.eclipse.jetty.start.Main.main(Main.java:111)
Caused by: java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Program Files (x86)\myapp\Data-Batch-Server"
    at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
    at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
    at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
    at sun.nio.fs.WindowsFileSystem.<init>(Unknown Source)
    at sun.nio.fs.WindowsFileSystemProvider.<init>(Unknown Source)
    at sun.nio.fs.DefaultFileSystemProvider.create(Unknown Source)
    at java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(Unknown Source)
    at java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(Unknown Source)
    at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(Unknown Source)
    at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(Unknown Source)
    at java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(Unknown Source)
    ... 6 more

Usage: java -jar start.jar [options] [properties] [configs]
       java -jar start.jar --help  # for more information

私は何を間違っていますか助けてください

4

1 に答える 1