• 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

Tomcat stop issue using ant

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am getting the following exceptions when i ran tomcat-stop ant task. I am using jdk 1.6. Please help me over this.

<target name="tomcat-stop">
<java jar="/${Tomcat5}/bin/bootstrap.jar"
fork="true"
jvm="/usr/bin/java" >
<arg value="-stop"/>
</java>
</target>


tomcat-stop:
Executing '/usr/bin/java' with arguments:
'-jar'
'/opt/Tumri/ics/current/tomcat5/bin/bootstrap.jar'
'-stop'

The ' characters around the executable and arguments are
not part of the command.
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:222)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)

Thanks,
Ajay.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to add the jar file that contains the missing class to your classpath. (bootstrap.jar is very small; it contains only a tiny part of Tomcat.)
 
Ajay Vikas
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ulf for your quick reply.

I have added the classpath attribute and tried with other options still i find no progress.

Can you please provide any other ant task which i can run the tomcat.

Thank,
Ajay.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does "no progress" mean? Are you saying you added the jar file that contains the missing class, and now you're getting the exact same exception? TellTheDetails
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look in 'bootstrap.jar/META-INF/MANIFEST.MF' you will find this line this means that you need these jars ind your classpath.

In my version of Tomcat (v6.0.18) I don't have 'commons-logging-api.jar' and 'tomcat-coyote.jar' - so I think that these two jars can be left out - in my case.

But look inside YOUR version of Tomcat's bootstrap.jar and see what your dependencies are.
[ September 10, 2008: Message edited by: Rene Larsen ]
 
Ajay Vikas
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for all your replies.

I had seen all are in classapath. I could able to start the server by putting catalina.base.home pointing to tomcat home dir.
Server is starting and i configured in ant java spawn mode, it could able to open and run it , but stopping server, it is not reporting any thing...when i see the ps in linux it is running still...i am not sure of reason... please help me over this.

Thank you!!!

Thanks,
Ajay.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These is the start and stop task i 'catalina.sh', I think that you need to do like this in you ANT script.
[ September 10, 2008: Message edited by: Rene Larsen ]
 
Ajay Vikas
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Rene.

I have used the exec task and called stop script of the tomcat. It has worked. But still using java task to call start/stop of tomcat would be great!!!

Thank you for all your help!!!

Regards,
Ajay.
SCJP 1.4.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic