File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes @404 error posting here Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "@404 error posting here" Watch "@404 error posting here" New topic
Author

@404 error posting here

naveen shrimal
Greenhorn

Joined: Dec 18, 2010
Posts: 14
404 error posting here



Sir,,
i am new to servlet and Tomcat...
I am getting 404 error...
I have done these ..
Setted all the 3 paths...
1. path for java
2. classpath for servlet-api.jar
3. JAVA_HOME for tomcat...
...
..
After these My Tomcat is being shown on Browser....after typing "http://localhost:8080" and hence Tomcat is working...


Now i created the directory structure as below for my Demo servlet program,,,,

C:\Users\RAKESH\Desktop\naveen\code\apache-tomcat-7.0.6\webapps\my\WEB-INF\classes\Demo.class



now when i run the servlet by typing

http://localhost:8080/my/servlet/Demo

I am getting status 404 error...so please help me out.....

thanks in advance........
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

1) Servlets should be placed in a package other than the default.

2) How do you have the servlet mapped in the deployment descriptor?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
naveen shrimal
Greenhorn

Joined: Dec 18, 2010
Posts: 14
i did not make any mapping.....no any web.xml...


n now when i try to run the examples provided by Apache Tomcat...even they are not running.....but I am getting apache running window in my browser...


Is it necessory to set catalina path......
i just set three environment variables
for java
JAVA_home for tomct
classpath for servlets ....


help me out
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

naveen shrimal wrote:i did not make any mapping.....no any web.xml...

Well, there's part of your problem.

now when i try to run the examples provided by Apache Tomcat...even they are not running.....but I am getting apache running window in my browser...

Apache and Tomcat listen on different ports. You need to get Tomcat up and running before trying to deploy your own apps.

Is it necessory to set catalina path......

No.

classpath for servlets ....

Classpath is only used during compilation. Tomcat does not use the classpath, so you don;t need to set one for Tomcat.
naveen shrimal
Greenhorn

Joined: Dec 18, 2010
Posts: 14
@ above thanks to both of you ....

solved my problem and it was associated with web.xml of Apache...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: @404 error posting here