Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ANT building: can't stop/start remote tomcat from ant script

807589Sep 6 2008 — edited Sep 8 2008
Hello, i'm trying to make an ant script that build from svn repository and copy the war on the remote server after having stopped tomcat and then restarting it.
At the moment i'm copying manually the .war file and then restart tomcat with tomcat/bin/./shutdown.sh and tomcat/bin/./startup.sh scripts.
The ant script is running fine but when i try to execute the code:
	<target name="stopServer">
		<exec executable="plink" failonerror="false">
			<arg line="${serverUsername}@${server} -pw ${serverPassword}" />
			<arg value="${server.home}/tomcat/bin/./shutdown.sh" />
		</exec>
	</target>
i get this error:
stopServer:
     [exec] Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
     [exec] At least one of these environment variable is needed to run this program
     [exec] Result: 1
while if i manually do the command i'm able to stop it:
C:\>plink username@some.server.com -pw password
Using username "username".
Linux ubuntu 2.6.17-11-generic #2 SMP Tue Mar 13 23:32:38 UTC 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
You have new mail.
Last login: Sat Sep  6 13:14:44 2008 from some.ip
&#8592;]0;username@ubuntu: /home/usernameusername@ubuntu:~$ /home/username/tomcat/bin/./shutdown.sh
Using CATALINA_BASE:   /home/username/tomcat
Using CATALINA_HOME:   /home/username/tomcat
Using CATALINA_TMPDIR: /home/username/tomcat/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun
So probably the command is executed before the plink is able to load the system variables like JAVA_HOME and so on?
Any help on how to fix that please? thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2008
Added on Sep 6 2008
10 comments
425 views