Java 如何将weblogic域作为windows服务运行

Java 如何将weblogic域作为windows服务运行,java,oracle,web-services,deployment,weblogic11g,Java,Oracle,Web Services,Deployment,Weblogic11g,我已经在weblogic server版本10.3.6上创建了一个域。 之后,我在该域上部署了war文件。 我的Windows服务器是Server2003 当我在mydomain\bin中启动startweblog.cmd时,我的服务器工作正常。 当我注销时,它会自动停止。在这里,我尝试创建oracle文档中描述的窗口服务 但我的服务不再说这与我无关 下面是我创建的两个文件 一,。在D:\WebLogic\user\u projects\domains\TEST\bin中运行.cmd { } 二

我已经在weblogic server版本10.3.6上创建了一个域。 之后,我在该域上部署了war文件。 我的Windows服务器是Server2003

当我在mydomain\bin中启动startweblog.cmd时,我的服务器工作正常。 当我注销时,它会自动停止。在这里,我尝试创建oracle文档中描述的窗口服务

但我的服务不再说这与我无关

下面是我创建的两个文件

一,。在D:\WebLogic\user\u projects\domains\TEST\bin中运行.cmd

{

}

二,。在D:\WebLogic\wlserver\u 10.3\server\bin中安装svc.cmd

{


}

尝试使用以下命令调试服务

beasvc -debug "<your_windows_service_name>"
@echo off
SETLOCAL



set ADMIN_URL=http://localhost:7005

set MEM_ARGS=-Xms256m -Xmx512m
pause




@rem Check that the WebLogic classes are where we expect them to be
:checkWLS
if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
echo The WebLogic Server wasn't found in directory %WL_HOME%\server.
echo Please edit your script so that the WL_HOME variable points 
echo to the WebLogic installation directory.
goto finish

pause

@rem Check that java is where we expect it to be
:checkJava
if exist "%JAVA_HOME%\bin\javaw.exe" goto runWebLogic
echo The JDK wasn't found in directory %JAVA_HOME%.
echo Please edit your script so that the JAVA_HOME variable 
echo points to the location of your JDK.
goto finish

pause
: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

@echo on

set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%

@echo ***************************************************
@echo *  To start WebLogic Server, use the password     *
@echo *  assigned to the system user.  The system       *
@echo *  username and password must also be used to     *
@echo *  access the WebLogic Server console from a web  *
@echo *  browser.                                       *
@echo ***************************************************

rem *** Set Command Line for service to execute within created JVM

@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.username=%WLS_USER% -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.management.username=%WLS_USER% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

:finish
rem *** Set up extrapath for win32 and win64 platform separately
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

rem *** Install the service
"%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%" -password:"%WLS_PW%" -cmdline:%CMDLINE%

ENDLOCAL
beasvc -debug "<your_windows_service_name>"