0

We are building our app on Linux using Ant and compilation is fine and during deploy on websphere (deploy-build.xml) we are using below code

<exec executable="${shell.cmd}" failonerror="true">
            <arg line="${wsadmin.cmd} -conntype ${wsadmin.conntype} -profileName ${was.profile} ${security.options} -lang jython -f ${scripts.dir}/app-server/jy/install-app.jy ${archive.location}"/>
        </exec>


        <echo message="${app.name} (${archive.location} deployed." />

from logs we can see install-app.jy execution is successful. But still we are facing below error:

BUILD FAILED
/home/EBbuild/env-build/b4b/env-build.xml:50: The following error occurred while executing this line:
/home/EBbuild/env-build/deploy-build.xml:185: exec returned: 99
        at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:613)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: /home/EBbuild/env-build/deploy-build.xml:185: exec returned: 99
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:613)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)

in above error message line 185 is exec code pasted above

We are using bash shell (linux)

4

2 回答 2

0

Is this the Windows cmd.exe you're executing as ${shell.cmd}?

If so, you may need to add /c as the first argument to your command line.

You may also want to try using ant -d (capture the output, it will produce quite a bit) to show you more details what is going on.

This will show you the actual command line being executed, and it might help you find errors. At least you can then run the commend directly from the command line.

There's no special meaning assigned to an exit code of 99. It maybe that your command is executing, hitting an issue and returning an exit code of 99.

It's really hard to say right now without the information from ant -d.

于 2013-09-04T17:48:28.927 回答
0

RC=99 originates from your Jython script, look at the source.
Use either ant -d env-build.xml (as David already mentioned) or :

<echoxml>
<exec executable="${shell.cmd}" failonerror="true">
 <arg line="${wsadmin.cmd} -conntype ${wsadmin.conntype} -profileName ${was.profile} ${security.options} -lang jython -f ${scripts.dir}/app-server/jy/install-app.jy ${archive.location}"/>
</exec>
</echoxml>

to see how your properties are resolved / how your Jython script is actually executed.
Afterwards start your Jython script standalone in bash (as David already mentioned) for further investigations.
Don't know Jython, but maybe it has a commandline parameter to increase it's noiselevel !?

于 2013-09-04T19:54:21.770 回答