梦开始的地方----

梦延续的港湾----

常用链接

统计

积分与排名

最新评论

weblogic 服务器在windows &linux自动关闭脚本

1、windows环境下面:
SETLOCAL

set JAVA_HOME=d:\bea\jdk141_05
for %%i in ("%JAVA_HOME%") do set JAVA_HOME=%%~fsi

set WL_HOME=d:\bea\weblogic81
for %%i in ("%WL_HOME%") do set WL_HOME=%%~fsi

set DOMAIN_HOME=D:\bea\user_projects\domains\mydomain
for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi

if NOT "%1"=="" (
 set UIDPWD=-username %1
 shift
)

if NOT "%1"=="" (
 set UIDPWD=%UIDPWD% -password %1
 shift
)

if ""=="true" (
 if "%UIDPWD%"=="" (
  echo ERROR: Because your domain was created as a production mode domain.
  echo You MUST include a username parameter that can be used to shutdown Weblogic Server
  pause
  GOTO :EOF
 )
)

@REM set ADMIN_URL

if NOT "%1"=="" (
 set ADMIN_URL=%1
) else (
 if "%ADMIN_URL%"=="" (
  set ADMIN_URL=t3://localhost:7001
 )
)

@REM Set classpath for shutting down both WLS and the debugger

set CLASSPATH=%WL_HOME%\server\lib\weblogic.jar;%WL_HOME%\server\lib\debugging.jar;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\common\lib\log4j.jar

set PATH=%WL_HOME%\server\bin;%PATH%

if "%SERVER_NAME%"=="" (
 echo Stopping the WebLogic Workshop Debugger...
 %JAVA_HOME%\bin\java -classpath %CLASSPATH% weblogic.debugging.engine.DbgMain -SHUTDOWN  1>&2 >"%DOMAIN_HOME%\debuggerShutdown.log"
 echo Done
)

echo Stopping Weblogic Server...

%JAVA_HOME%\bin\java -cp %CLASSPATH% weblogic.Admin FORCESHUTDOWN -url %ADMIN_URL% %UIDPWD% %SERVER_NAME%  1>&2

echo Done

if "%SERVER_NAME%"=="" (
 if "true"=="true" (
  echo Stopping Pointbase database server...
  call "%WL_HOME%\common\bin\stopPointBase.cmd" -port=9093 -name=workshop  2>&1 >"%DOMAIN_HOME%\pointbaseShutdown.log"
  echo Done
 )
)

exit

ENDLOCAL

注意:
1、windows下关键地方只要设置
set DOMAIN_HOME=D:\bea\user_projects\domains\mydomain

set ADMIN_URL=t3://localhost:7001

这两个地方正确就基本上可以了

2、linux环境下面:

set JAVA_HOME=home\j2sdk1.4.2_03
set PLATFORMHOME=\bea\weblogic81
set ARGUMENTS=weblogic.Admin FORCESHUTDOWN -url t3://192.168.0.2:80 -username admin -password 88888888
set CLASSPATH=%PLATFORMHOME%\server\lib\weblogic.jar
"%JAVA_HOME%\bin\java.exe" -cp "%CLASSPATH%" %ARGUMENTS%

注:
这个-url t3://192.168.0.2:80 -username admin -password 88888888
要输入你weblogic正确地址和你配置的 administrator的用户名和密码;其他的也就是一些环境变量的设置,


 

posted on 2005-11-14 13:19 梦延续的港湾----依然是蓝 阅读(2096) 评论(0)  编辑  收藏 所属分类: java


只有注册用户登录后才能发表评论。


网站导航: