aspose file tools*
The moose likes Tomcat and the fly likes please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "please help" Watch "please help" New topic
Author

please help

Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
I was trying to run a servlet program in Tomcat. I placed the compiled a.class file in the directory of WEBAPP/ROOT/WEB-INF/classes, however when I try to run http://localhost/servlet/a, Tomcat can't find the file. How should I set up the Tomcat so that this will work.
Thanks in advance.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Are you omitting the port?
Tomcat listen by default in the 8080.
If your Tomcat is running you could access it at http://localhost:8080/...
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
did you modify web.xml ??


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Nicolas Brasseur
Ranch Hand

Joined: Nov 09, 2001
Posts: 45
Since version 4.1 Tomcat doesn't support calling servlets using their fully qualified classname. So I think you'll be forced to modified the web.xml file located in the web-inf directory of your web application.
ex :

The url used to call you servlet should be something like
http://127.0.0.1:8080/Hello
if the webapp where your servlet is deployed is the ROOT webapp of tomcat else the url will be
<a href="http://127.0.0.1:8080/<i rel="nofollow">webappname</i>/Hello" target="_blank">http://127.0.0.1:8080/webappname/Hello
Hope it helps
Nicolas


<a href="http://www.javablackbelt.com/?utm_source=javaranch&utm_medium=signature&utm_campaign=Forum%2BBuzz" target="_blank" rel="nofollow">BlackBeltFactory Communtiy</a> founder - Building better developers<br /><b>Free</b> courses and mock exams
suresh guru
Ranch Hand

Joined: Sep 07, 2002
Posts: 38
yes I agree with Nicolas . But i think u have to put the classfile in the examples's web-inf directory & modify the web.xml there as said my Nicolas
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
Thanks all. The problem is as stated by Nicolas, seems that Tomcat4 doesn't support class by calling its full name. I solved the problem by modifying web.xml. Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please help
 
Similar Threads
Deploy servlet
HelloServlet not running ?
Servlets..
how can test my servlet in tomcat
Please help