• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Start Tomcat 6 from Ant

 
Manuel Vargas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank arun,
I will add the classpath.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mdvr vr", please check your private messages for an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic