• 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 Help!

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi !
I have Win ME and i have installed Tomacat 4 properly and i see the indexpage and everything. When i try to run my servlet from the root/WEB-INF/classes folder i get Error 404. I made a folder called classes in the webapps/Root/WEB-INF folder and have placed my servlet there,but i fail to understand how to run it now... please help

taash
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try mapping your application in web.xml.
uma
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Uma,
Thanks a lot
let me try that and then get back yo u.
i hope it works
Taash
Sun Certified Java 2 Programmer
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Uma,
It didn't work
i think the problem is something else. i may not have done things properly.I am giving u all the details again. please tell me where am i wrong
i have installed Apache Tomcat4.0.3 in my Program Files and then i have made a dir like
../webapps/Root/Web-Inf/classes/hello.class where hello is my servlet class.
My jdk is on my c: and works properly
i tried to compile my servlet with my JSDK2.0 and it worked fine. but when i put the same file in my tomcat ../webapps../classes file i cannot see it from my Dos prompt neither am i able to compile it from there. i tried putting the class file there and running it but always i get the Error 404. Although i am able to see the examples dir and all the examples are executed fine with tomcat. i cannot see this dir. nor can i see the webapps/Root folder if i say http://localhost:8080/Root..
i again get error 404 so how do i work this out?
Please help ASAP
thanks in advance
Taash
Sun Certified Java 2 Programmer
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
Something that i find very strange in the this process is that the files and folders i create in ../Root/WEb-INF folder cannot be sen from the Dos prompt. I m totally confused as to how should i work it out. i can run all the examples but thats about it. i have mapped my servlet in the web.xml file too but nothing is happening
my autoexec.bat has this
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF;C:\JDK1.3\BIN;C:\JSDK2.0\BIN
SET CLASSPATH=.;C:\JDK1.3\LIB;C:\JSDK2.0\LIB;C:\JSDK2.0\SRC;,;C:\PROGRA~1\
JAKARTA-TOMCAT4.0.3\common\lib\servlet.jar
SET JAVA_HOME=C:\JDK1.3
SET CATALINA_HOME=C:\pROGRA~1\JAKARTA-TOMCAT4.0.3

have i missed something somewhere..
Please help ASAP
thanks in advance
taash
SCJP2
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"taash" and "ushakthi"

Please change your display name to comply with our naming policy (the one you agreed to follow when you signed up).

Thanks, and welcome to JavaRanch.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's time you posted a copy of your web.xml file.
Please use the CODE UBB tags so your file will be readable.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi;
Have you modified the server.xml under /conf?
If i were you, i would add the <DefaultContext reloadable="true" /> tag above <!-- Tomcat Root Context --> line in the server.xml and
then save this file.
Then re-start Tomcat.. May be this will help.. Let me know about the result.
Cheers;
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!

firstly thanks for replying Tim and Ercan.
Ercan i have already changed server.xml to the effect but still am getting nowhere. I ma sending u a copy of my web.xml file where i have done the mapping to my servlet "h". please let me know if u folks thinks of anything that would help me start my journey with tomcat.
part of server.xml

web.xml file


Thanks again
taash
scjp2
 
Ercan Erciyes
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi;
just place your class file under /webapps/Root/Web-Inf/classes and try http://localhost:8080/servlet/ClassFileName ..In this case you dont have to use any web.xml file.
But If you need to read some values from web.xml, try to create a war file (jar cvf warname.war Web-Inf) and place it to /webapps folder. Then run the Tomcat again..You will see that a folder has been created. Then reach your application by following this address http://localhost:8080/warname ..
Have fun;
Cheers
 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try http://localhost:8080/hello.class
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
Thnaks for replying Ercan. "h" is a simple servlet just like the hello servlet. it just prints a message with a println statement and i have tried placing it under /webapps/Root/WEB-INF/classes but when i place it there it is not seen on my dos prompt, the file i mean and so i can't compile it. Now i have no values to retieve from the web.xml file but i was just tryting to check if anything happens if i map my servlet there. So far i haven't been able to comeup with a solution so if u have anything u think might help please do let me know. or else ithink i will try JSWDK on which i have worked earlier.
Thanks again
taash
scjp2
 
taash mg
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks!
Thanks a lot for all ur help. I just got wind of my silly mistake. so now i am all set with Tomcat4.0.3. I had actually not put my files in the proper folder. There's a Apache-tomcat4.0.3 on my disk and a jakarta-tomcat4.0.3 and i was putting my files in Apache and checking in jakarta..really silly. But now that i know i can start writing my servlets and JSPs
Cheers
taash
scjp2
 
Evacuate the building! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic