Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat stop issue using ant

 
Ajay Vikas
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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
  • 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: 42967
73
  • Mark post as helpful
  • send pies
  • 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
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic