This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server can't find my servlets

 
Tristan Van Poucke
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this being installed as the root application? If not, you need to prepend the URLs with the context path.
 
Tristan Van Poucke
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its being deployed as the root application.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes my server runs on a UNIX system, yet I am working on Windows XP.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic