当前位置: 首页 > 知识库问答 >
问题:

如何将weblogic域作为Windows服务运行

阎兴为
2023-03-14

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

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

这是我创建的2个文件

1.)run.cmdD:\WebLogic\user_projects\domain\TEST\bin

{

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

}

共有1个答案

关飞翔
2023-03-14

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

beasvc -debug "<your_windows_service_name>"
 类似资料:
  • 问题内容: 我在Windows 7 32位操作系统中安装了postgreSQL二进制文件;我可以从cmd启动服务器,但 不能将其作为Windows服务运行。 这是我尝试手动启动服务时遇到的错误: 我要做的就是 双击我的Java应用程序启动到Windows后,我需要流畅地运行我的应用程序而没有任何数据库错误。我不能这样做,因为postgreSQL没有作为Windows服务运行。 我在Windows事

  • 问题内容: 我正在草拟一组程序的体系结构,这些程序共享存储在数据库中的各种相互关联的对象。我希望其中一个程序充当服务,为这些对象的操作提供更高级别的接口,而其他程序则通过该服务访问对象。 我目前的目标是将Python和Django框架作为实现该服务的技术。我很确定自己知道如何守护Linux中的Python程序。但是,这是系统应支持Windows的可选规格。我几乎没有Windows编程经验,也没有W

  • 我正在试用neo4j2.0 for Windows的社区版测试版,但我看不到将其作为一项服务来安装的方法。启动Neo4j的唯一方法似乎是通过neo4j-community.exe,但这需要交互性才能按下开始按钮。在1.x版本中存在的批处理文件消失了。 有人有什么想法吗?

  • 我从https://download.Redis.io/redis-stable/sentinel.conf下载了sentinel.conf文件,并将其放到默认的Redis安装位置C:\Program Files\Redis。然后对配置文件应用以下更改。 文件更改 端口26379 守护yes 监视mymaster{IP地址}{端口}1 毫秒后向下哨兵mymaster 30000 哨兵并行-同步my

  • 问题内容: 我没有找到关于如何注册一个将接口实现为Windows服务的类的非常好的示例(实际上我没有找到一个示例)。 我是否必须使用procrun注册该实现?但是实现该接口似乎没有意义,因为procrun可以将任何程序注册为Windows服务。 此外,procrun页面(http://commons.apache.org/proper/commons- daemon/procrun.html )上

  • 问题内容: 我遇到了一个非常奇怪的问题。我需要在Jenkins中配置代理,以便 能够访问其中一项作业的SVN存储库。我这样做有两种方式: 从命令行使用必需的参数启动Jenkins 在jenkins.xml文件中定义参数时,将Jenkins作为Windows服务启动。 Starting from command line : -Dhudson.model.DirectoryBrowserSuppor