【问题标题】:how to run weblogic domain as windows service如何将 weblogic 域作为 Windows 服务运行
【发布时间】:2015-05-15 09:27:45
【问题描述】:

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

当我在 mydomain\bin 中启动 startWebLogic.cmd 时,我的服务器工作正常。 当我注销时它会自动停止。在这里,我尝试按照 oracle 文档“http://docs.oracle.com/cd/E11035_01/wls100/server_start/winservice.html”中的描述创建一个窗口服务。

但我的服务不再说它无关。

这是我创建的 2 个文件

1.) D:\WebLogic\user_projects\domains\TEST\bin 中的 run.cmd

{

SETLOCAL
set DOMAIN_NAME=TEST

set USERDOMAIN_HOME=D:\WebLogic\user_projects\domains\TEST

set WL_HOME=D:\WebLogic\wlserver_10.3
set SERVER_NAME=AdminServer
set JAVA_HOME=D:\Java\jdk1.7.0_79\jdk1.7.0_79

set WLS_USER=weblogic
set WLS_PW=weblogic123
pause
set PRODUCTION_MODE=true
pause
CALL D:\WebLogic\wlserver_10.3\server\bin\installSvc_Ank.cmd
pause
ENDLOCAL

}

2.) 在 D:\WebLogic\wlserver_10.3\server\bin 中安装Svc.cmd

{

@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

}

【问题讨论】:

    标签: java oracle web-services deployment weblogic11g


    【解决方案1】:

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

    beasvc -debug "<your_windows_service_name>"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多