• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Start Tomcat 6 from Ant

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank arun,
I will add the classpath.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"mdvr vr", please check your private messages for an important administrative matter.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic