aspose file tools*
The moose likes Servlets and the fly likes Server can't find my servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Server can Watch "Server can New topic
Author

Server can't find my servlets

Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
When I was working on a localhost , tomcat found all my servlets without problems, but now that ive uploaded my website to a web host. The server suddenly can't find my servlets. I know this could be because of the web.xml file, because the server needs to be restarted for it to work right? Is there any way to check if the server is using the correct web.xml file?
Or could there be another problem.

this is how I call one of the servlets:



the web.xml file:
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61418
    
  67

Is this being installed as the root application? If not, you need to prepend the URLs with the context path.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
Its being deployed as the root application.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61418
    
  67

Also, what's with the back slashes in the form tag?

Can you access anything in the web app? Have you determined whether it's even running or not?
Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
the backslashes are there because I generate the form from a java class.
And I can see the form in the browser so I conclude that the webapp is running but i can't seem to find the servlets i have made.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61418
    
  67

What's the error? A 404?

Can you access the servlet from the address bar by typing in the URL?
Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
Its a 404 error.

I can't access the servlet from typing in the servlet url in the address bar. But I am sure the servlet.class is on the server, and web.xml aswell.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61418
    
  67

Grasping at straws: is your server a different OS than your local machine? Could it be a casing issue?

I noticed that you use mixed case for package names (not conventional).
[ September 10, 2008: Message edited by: Bear Bibeault ]
Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
Yes my server runs on a UNIX system, yet I am working on Windows XP.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61418
    
  67

Ah! Then one possibility is that you have a typo with differing case. Windows being case-insensitive might treat Xyz the same as xyz. But any unix-based system will not!

First, I'd recommend following convention and using all lowercase for package names, and be sure that your folder names are all lowercase as well. That not only conforms to convention, it removes lots of possibilities for casing mismatches.

Then go through the app looking for casing inconsistencies.
[ September 10, 2008: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server can't find my servlets