cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

restarting Windchill using ANT

SimonLucas
1-Newbie

restarting Windchill using ANT

Hi,



currently developing an ANT script to apply a load of business config. I can stop both Windchill and TOMCAT no problem, and re-start TOMCAT co problem. However when I try to restart Windchill, although the server manager and method server start OK, the ANT script hangs and so does not complete steps following teh windchill start.


The ant targets I am using to stop windchill & tomcat, cleare the tomcat cache and restart both tomcat and windchill is as follows:



	<target name="stop_servers" depends="loadProps">
<exec executable="${wchome}/bin/windchill.exe">
<arg line="stop"/">
</exec>
<exec executable="net">
<arg line="stop" ${tomservice}&quot;="/>
</exec>
</target>


<target name="clear_cache" depends="stop_servers">
<delete dir="${tomcat_cache}"></delete>
</target>




<target name="start_servers" depends="clear_cache">
<exec executable="net">
<arg line="start" ${tomservice}&quot;="/>

</exec>
<exec executable="${wchome}/bin/windchill.exe">
<arg line="start"/">
</exec>

</target>

Am I doing something wrong or is this an issue?



Using 9.1 M062 by the way on a Windows server.



Cheers



Simon Lucas


5 REPLIES 5
jessh
5-Regular Member
(To:SimonLucas)

I don't know why you'd be seeing a hang, but I would suggest that
deleting the Tomcat work directory should only be done when one has
installed a patch, MOR, or customization update. Otherwise you're just
ensuring slower response times until all the JSPs are recompiled.

--
Jess Holle

Hi,

I do not unfortunately. Investigated but didn't found any way.

Regards,

Thibault Magné

Le 4 janvier 2012 15:23, Lucas, Simon <-> a écrit :

> Perfect - worked a treat.****
>
> ** **
>
> Do you know if it is possible to check if server has started before
> continuing?****
>
> ** **
>
> Many thanks.****
>
> ** **
>
> *Simon Lucas* BSc DipDesInn
> PLM Business Administrator****
>
> Ricardo UK Ltd****
>
> ** **
>
> *From:* Thibault Magné [
> <echo message="Starting" tomcat...&quot;="/>
> <exec<br/>> executable="${windchill.home}/../Tomcat/bin/wttomcat_start.bat"
> spawn="true"/>
> <echo message="Starting" windchill=" servers...&quot;="/>
> <exec executable="${windchill.home}/bin/Windchill.exe"&lt;br"/>> spawn="true">
> <arg value="start"/"...






























































































No problem. Thanks for your help anyway.









From: Thibault Magné [

Hi,

I've already met this problem when starting up the server. I've solved it using the following script:


<echo>processing windchillStart</echo>


<exec dir="${wt.home}${file.separator}bin" executable="windchill" vmlauncher="false">


<arg value="start"/>


</exec>



Be aware of something by using these scripts : if your Windchill servers usually start as Windows Services, the stop and start scripts will result in new processes created by the logged user and

Here are ANT targets (that can be added to your ANT project) to start and stop Tomcat and server Manager/Method Server


These assume Apache is running, and that Tomcart and Server Manager/Method Server are not running as services (we use these command on our development machines as part of the deployment process.



<property name="windchill.home" location="C:/ptc/Windchill_9.1/Windchill"/">



<target name="stopTomcat">

<exec executable="${windchill.home}/../Tomcat/bin/wttomcat_stop.bat"/>
</target>

<target name="startTomcat">

<exec spawn="true" executable="${windchill.home}/../Tomcat/bin/wttomcat_start.bat"/>
</target>

<target name="startMethodServer">

<exec spawn="true" executable="${windchill.home}/bin/windchill.exe">
<arg value="start"/">
</exec>
</target>

<target name="stopMethodServer">

<exec executable="${windchill.home}/bin/windchill.exe">
<arg value="stop"/">
</exec>
</target>

<target name="startServers">
<antcall target="startTomcat"/>
<antcall target="startMethodServer"/>
</target>

<target name="stopServers">
<antcall target="stopTomcat"/>
<antcall target="stopMethodServer"/>
</target>



Let me know if you have any questions.


Thanks -


Todd

Announcements


Top Tags