Starting of Tomcat failed

Some day I had problem with deploying project from Netbeans to Tomcat (you may look to similar discussion on StackOverflow: Starting of Tomcat failed from Netbeans 7.3). Unfortunatelly, any of suggestion didn’t help, so I wrote my own deployer in Windows batch.

Some code:

ECHO AutoDeploy to Tomcat

SET tomcat_path=C:\TOMCAT
SET build_path=D:\SVN\SMOK_ELTE\JAVA\amfgw\build\web\WEB-INF\classes

::Stop Tomcat
echo Stop Tomcat, press any key to continue...

netstat -a -n | findstr :8080 > NUL
if %errorlevel%==0 ( goto :stoptomcat ) else ( goto :next )
echo Closing Tomcat.
call %tomcat_path%\bin\shutdown.bat
goto :next

::Copy compiled classes from Netbeans to Tomcat
XCOPY %build_path% "%tomcat_path%\webapps\ROOT\WEB-INF\classes" /E /C /R /I /K /Y

::Run Tomcat
CALL %tomcat_path%\bin\catalina.bat jpda start

But I wanted more – let Netbeans run this script after building my application.

Edit build.xml file, located in project directory, by putting these lines:
<target name="-post-compile">
<exec dir="." executable="cmd">
<arg line="/c D:\scriptLocation\deployOnTomcat.bat"/>

Przydatny wpis? Postaw mi kawę :)

Dodaj komentarz

1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
0 Comment authors
How to debug remote application on Tomcat | Mój skrawek Sieci Recent comment authors
najnowszy najstarszy oceniany
Powiadom o

[…] time ago I wrote about a situation when starting of Tomcat from Netbeans failed. Of course when someone follows with steps prepared in this article, debugging is more complicated. […]