我为WebLogic服务器创建了一个新的ActiveDirectoryAuthenticator用户,并将凭据添加到<Server>/security
文件夹下的boot.properties文件中。当我使用startWebLogic.cmd启动服务器时,它会使用指定的用户正确引导它。但是,当我通过示例http://docs.oracle.com/cd/E13222_01/wls/docs81b/adminguide/winservice.html来创建服务或尝试修改某人几年前创建的脚本时,它不会使用正确的用户启动服务器。
我做错了什么?
@echo off
SETLOCAL
set DOMAIN_NAME=<domain_name>
set SERVER_NAME=<server_name>
set MAX_CONNECT_RETRIES=2
set HOST=localhost
set PORT=7011
set USERDOMAIN_HOME=F:\bea1032\user_projects\domains\<domain_name>
set WL_HOME=F:\bea1032\wlserver_10.3
call "%WL_HOME%\common\bin\commEnv.cmd"
:checkWLS
if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
goto finish
:checkJava
if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic
goto finish
:runWebLogic
if not "%JAVA_VM%" == "" goto noResetJavaVM
if "%JAVA_VENDOR%" == "BEA" set JAVA_VM=-jrocket
if "%JAVA_VENDOR%" == "HP" set JAVA_VM=-server
if "%JAVA_VENDOR%" == "Sun" set JAVA_VM=-server
:noResetJavaVM
if not "%MEM_ARGS%" == "" goto noResetMemArgs
set MEM_ARGS=-Xms32m -Xmx200m
:noResetMemArgs
set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%
@echo off
if "%ADMIN_URL%" == "" goto runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.server=\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
goto finish
:runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
:finish
if "%WL_USE_X86DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\32;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\32\oci920_8
if "%WL_USE_IA64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\64\oci920_8
if "%WL_USE_AMD64DLL%" == "true" set EXTRAPATH=%WL_HOME%\server\native\win\x64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\x64\oci920_8
"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -cmdline:%CMDLINE%
ENDLOCAL
答案 0 :(得分:1)
我实际上能够通过使用该用户运行服务而不是LOCAL SYSTEM来使其工作。