Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes ControllerServlet Not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ControllerServlet Not found" Watch "ControllerServlet Not found" New topic
Author

ControllerServlet Not found

John Koe
Greenhorn

Joined: Nov 01, 2009
Posts: 6
Hi,

I have a website www.simbiz2010.com when I try to press the login button on the leftcol it shows 404 Not Found- The resource requested could not be found on this server!

Please help as I don't know what is going on.. i have the web.xml allright I think so I don't really know what I'm missing.

Thanks very much.

regards,
J
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Please TellTheDetails. It's hard to know what's going on without any details, tell us what are the components involved, mappings, how you invoke the servlet etc..


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
Post the relevant parts of the web.xml file, and tell us which URL you're trying to access, and the name of the web app context.


Ping & DNS - my free Android networking tools app
John Koe
Greenhorn

Joined: Nov 01, 2009
Posts: 6
Hi,

website address is www.simbiz2010.com
The web is loading fine.. but when I click on the Login button it is said www.simbiz2010.com/ControllerServlet 404 NOT Found

I have public_html\WEB-INF\classes\ControllerServlet.class

This is my web.xml



Thank you.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Your WEB-INF should be directly inside the web application folder. And the web.xml should be directly inside the WEB-INF.
John Koe
Greenhorn

Joined: Nov 01, 2009
Posts: 6
Yes.. I've already done that.

It works fine in my localhost:8080/

But when I deploy it in the actual web server it shows that 404 error.

Thank you.

Vijitha Kumara wrote:Your WEB-INF should be directly inside the web application folder. And the web.xml should be directly inside the WEB-INF.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

John Koe wrote:Yes.. I've already done that.
It works fine in my localhost:8080/

public_html\WEB-INF\classes\ControllerServlet.class

What is the name of the context then?
John Koe
Greenhorn

Joined: Nov 01, 2009
Posts: 6
http://localhost:8080/Simbiz2010/ if I open it from my PC

as in the web server I just put it in the root (/public_html)

Thanks.

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

What is the application server you are running? I suggest you put the application as a separate one.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
John Koe wrote:as in the web server I just put it in the root (/public_html)

That's unlikely to be the right place for a web app. What kind of server is this - does it actually support Java web apps?
John Koe
Greenhorn

Joined: Nov 01, 2009
Posts: 6
It is UNIX apache with tomcat 5.5 installed.

But the jsp is loading fine.. so does this mean the server does not support the servlet ?
is the jsp and servlet are two different things ? ( if jsp is loading fine than the servlet should also be working ?)

sorry this is the first time I use jsp.

THank you.

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

John Koe wrote:It is UNIX apache with tomcat 5.5 installed.
But the jsp is loading fine.. so does this mean the server does not support the servlet ?

As you are using Tomcat 5.5, It supports Servlet 2.4/JSP 2.0.
is the jsp and servlet are two different things ?

Well, JSP is actually converted in to a servlet eventually. You will find lots of information on that on our FAQ's section as well as on the web.
Now where exactly you have put your web app in the server (that should be under the "webapp" directory of Tomcat) ?
Mourouganandame Arunachalam
Ranch Hand

Joined: Oct 29, 2008
Posts: 396
based on your web.xml, you should keep your ControllerServlet class under the package controller (ie., ..\WEB-INF\classes\controller)


Mourougan
Open Source leads to Open Mind
azhar jodatti
Greenhorn

Joined: Oct 18, 2009
Posts: 12
hey john...

you are getting this problem becuase your directory structure is not following the spec....

you kept your class direclty in classes folder under web-inf... and in DD you are telling that your class is in controller package... if you have used package in your class then just keep your .class file in package name controller and your problem wil get solved...



..FEEL IT..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ControllerServlet Not found
 
Similar Threads
Java 1.4 to Java 6 migration
JSP loading fine but ControllerServlet not found
How to test web application made using Eclipse Web Tools Project??
ArrayList seems to be not working
ORM for Android