【问题标题】:Websphere bat files exits the batch fileWebsphere bat 文件退出批处理文件
【发布时间】:2013-04-10 11:10:38
【问题描述】:

我正在编写脚本来自动将 ear 部署到 websphere 并在应用程序上创建变量。

我的问题是 manageprofiles 和 startserver bat 文件退出了我的批处理并进入下一步我必须多次调用它

这是我的脚本

FOR /F "tokens=*" %%i in ('type params.properties') do SET %%i
REM SET PATH=%PATH%;%AppServerPath%\bin
REM CALL setupCmdLine.bat -create -profileName %profile% -profilePath "%AppServerPath%\profiles\%profile%" -templatePath "%AppServerPath%\profileTemplates\default"

"%AppServerPath%\bin\manageprofiles" -listProfiles | findstr -i %profile% > nul:
if %ERRORLEVEL%==1 (
  ECHO Creating profile %profile% on %AppServerPath%\profiles\%profile%
  "%AppServerPath%\bin\manageprofiles" -create -profileName %profile% -profilePath "%AppServerPath%\profiles\%profile%" -templatePath "%AppServerPath%\profileTemplates\default"
)

ECHO Getting profile path
FOR /F "delims=" %%a IN ('manageprofiles -getPath -profileName %profile%') DO @SET PROFILEPATH=%%a

REM SET PATH=%OLD_PATH%;%PROFILEPATH%\bin
FOR /F "tokens=7 delims= " %%H IN ('serverStatus server1 ^| findstr "Application Server"') DO (
    IF /I "%%H" NEQ "STARTED" (
v       ECHO Starting server1
        startServer server1
    )
)

"%PROFILEPATH%\bin\wsadmin" -lang jython -f EEDeployer.jy "%PROFILEPATH%"

有任何想法或替代方法来检查配置文件并在不存在时创建它然后在其上启动 server1?

【问题讨论】:

    标签: deployment batch-file automation websphere websphere-7


    【解决方案1】:

    您需要CALL 一个批处理以允许处理返回到主批处理。

    如果您只是从批处理中执行批处理,则转移控制权,但不会记录返回。

    CALL   "%AppServerPath%\bin\manageprofiles" ...
    

    应该可以解决您的问题。用 startserver 重复...

    【讨论】:

    • 有时您只是看不到最明显的部分。 (用头撞砖墙)
    猜你喜欢
    • 1970-01-01
    • 2022-01-05
    • 2013-07-13
    • 1970-01-01
    • 1970-01-01
    • 2010-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多