This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Start Tomcat 6 from Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Start Tomcat 6 from Ant" Watch "Start Tomcat 6 from Ant" New topic
Author

Start Tomcat 6 from Ant

Manuel Vargas
Greenhorn

Joined: Aug 01, 2008
Posts: 2
Hello,

I'am working with ant and I defined a task that starts the tomcat bootstrap:


<target name="tomcat-start">
<java jar="C:/Program Files/Apache Software Foundation/Tomcat 6.0/bin/bootstrap.jar"
fork="true"
jvm="C:/Program Files/Java/jdk1.5.0_14/bin/java.exe" >
<arg value="-start"/>
<jvmarg value=
"-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0
-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 6.0
-Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 6.0\common\endorsed
-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\logging.properties -Xdebug -Xrunjdwp:transport=dt_socket,address=1040,server=y,suspend=n"/>
</java>
</target>

But the problem arise when I run the ant with eclipse 3.3. THe console shows:


Buildfile: C:\Docum....workspace\Selenium Tests\build.xml
tomcat-start:
[java] java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[java] at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:215)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)

Why? I can�t find the solution...
I would be very grateful is someone who have the same experience tell me some information.

Thanks much.


arun nohwar
Greenhorn

Joined: Aug 05, 2008
Posts: 16
Because the class org.apache.catalina.startup.Catalina is present in catalina.jar.
You will need to setup the classpath containing all jar files in <CatalinaHome> using classpath attribute of ant task java.
Manuel Vargas
Greenhorn

Joined: Aug 01, 2008
Posts: 2
thank arun,
I will add the classpath.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

"mdvr vr", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Start Tomcat 6 from Ant
 
Similar Threads
Problem running simple Servlet on Tomcat
context getAttribute code doubt
Tomcat stop issue using ant
spring application does not delop successfully...
Difficulty in executing