ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neilac333 <chaudhu...@centechgroup.com>
Subject Running a Remote Ant Target from Another
Date Tue, 05 Feb 2008 23:23:12 GMT

I am running an Ant script that generates a WAR file, copies it from my
desktop to my development server, and calls a target in another Ant script
on that development server which runs a WebLogic script that deploys the WAR
file to the WebLogic instance on the development server.

Incidentally, this issue has nothing to do with WebLogic.

Here is the Ant target on my desktop:

<target name="deploy-war-to-dev" depends="war-for-dev">
      <copy todir="${deploy.dir}">
         <fileset dir="${dist.dir}"/>
      </copy>
      <ant dir="${deploy.dir}" antfile="build-weblogic-deployment.xml"
target="deploy-to-weblogic" inheritrefs="false" inheritall="false">

      </ant>
</target>


Here is the target on the dev server:

<target name="deploy-to-weblogic">
      <exec executable="${weblogic.bin.dir}/setWLSEnv.cmd" />
      <wlst debug="true" failOnError="true">
         <script>
            WL Jython stuff
         </script>
      </wlst>
   </target>


When the <exec> target is run, I get the following error:


java.io.IOException: CreateProcess:
..\..\weblogic92\server\bin\setWLSEnv.cmd error=2
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
	at java.lang.ProcessImpl.start(ProcessImpl.java:30)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
	at java.lang.Runtime.exec(Runtime.java:591)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:828)
	at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
	at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:621)
	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.GeneratedMethodAccessor6.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	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:1329)
	at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	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:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.Main.runBuild(Main.java:698)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)


I have tried using an absolute path to that .cmd file to no avail.  From my
research, it seems the cause might be the JRE being located on my local
machine while running an executable on another machine.  Is there a way I
can set the JAVA_HOME in my remote target from the local target?  Would that
even help?

Any insight is appreciated.

Thanks.


-- 
View this message in context: http://www.nabble.com/Running-a-Remote-Ant-Target-from-Another-tp15300073p15300073.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message