0

IBM RAD \ RSA 8でANTスクリプトを実行して、Websphereにデプロイしようとしています。WS_ANT.batを使用してコマンドプロンプトから実行すると正常に動作しますが、RAD内で次のエラーが発生して失敗します

Unable to determine WAS Home directory. Please use the wasHome task attribute or set the was.root System property.

以下は、SOからコピーされた基本的なANTスクリプトであり、ModifiedはWS_ANTからは正常に実行されますが、RADからは正常に実行されません。

<?xml version="1.0"?>
<projectname="project"default="wasListApps"basedir=".">
        <description>
        Script for listing installed apps.
        Example run from:
        /opt/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/bin
    </description>

        <propertyname="was_home"location="C:\Program Files\ibm\SDP80\runtimes\base_v7"/>       

        <pathid="was.runtime">
                <filesetdir="${was_home}/lib">
                        <includename="**/*.jar"/>
                </fileset>
                <filesetdir="${was_home}/plugins">
                        <includename="**/*.jar"/>
                </fileset>
        </path>
        <propertyname="was_cp"value="${toString:was.runtime}">
        </property>
        <propertyname="was_server"value="server1"/>
        <propertyenvironment="env">
        </property>

        <targetname="wsStopServer">
                <taskdefname="wsStopServer"classname="com.ibm.websphere.ant.tasks.StopServer"classpath="${was_cp}">
                </taskdef>
                <wsStopServerserver="${was_server}"failonerror="false"/>
        </target>

        <targetname="wsStartServer" depends="wsStopServer">
                        <taskdefname="wsStartServer"classname="com.ibm.websphere.ant.tasks.StartServer"classpath="${was_cp}">
                        </taskdef>
                        <wsStartServerserver="${was_server}"failonerror="true"/>
                </target>


        <targetname="wasListApps"depends="wsStartServer">
                <taskdefname="wsListApp"classname="com.ibm.websphere.ant.tasks.ListApplications"classpath="${was_cp}">
                </taskdef>
                <wsListAppwasHome="${was_home}"/>
        </target>

</project>
4

1 に答える 1

0

If you look at the ws_ant.bat file you will find it calls the setupCmdLine.bat first thing to, you guessed it, setup the command line. That file tries to determine the WAS_HOME environment variable by setting it to the parent directory.

SET CUR_DIR=%cd%
cd /d "%~dp0.."
SET WAS_HOME=%cd%
cd /d "%CUR_DIR%"

This is fine when you run from the command line. You are usually in the ~/SDP/runtimes/base_v7/bin (or other server version) directory. The parent is where you want to be.

I would look into setting the working directory when you run the ws_ant.bat script. That is probably the most likely cause.

于 2011-08-22T15:49:49.693 に答える