| Author |
HTTP Status 404 - Servlet is not available
|
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
Hello
I'm a greenhorn, so any help is greatly appreciated. I setup a website using Netbeans 6.8 for our family business using jsp, servlets, and html. On the localhost, the website works with no issues. I recently uploaded to a webserver. The html pages work fine, but the servlets do not. I think I may have a problem with the web.xml file. I stored the servlets in public_html/WEB-INF/classes/controller.
Here is the web.xml file
I amended the xml file below.
Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
|
Please UseCodeTags.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2691
|
|
Howdy Christopher,
Welcome to JavaRanch
Christopher Meadows wrote:
<servlet-class>com.classes.controller.info_FuneralServlet</servlet-class>
Are you sure that info_FuneralServlet is the exact class name and you've packaged it to the "com.classes.controller" package? Comparing to the other classes in the controller package, I think it might be something like "controller.info_FuneralServlet "
|
Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
|
By the way, not following standard Java naming conventions makes your code surprisingly hard to read. "info_" is not a proper way to name a class.
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
I'm sorry for improper CodeTag.
The xml file is located at public_html/WEB-INF
The servlets are located in public_html/WEB-INF/classes/controller
This an abbreviated xml file
The website loads, but the servlet is blank.
http://www.meadowsfuneralhomeinc.com
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
|
Again: please UseCodeTags
|
 |
Mark E Hansen
Ranch Hand
Joined: Apr 01, 2009
Posts: 639
|
|
So what URL are you browsing to?
Is the Servlet getting called? Can you please some System.out.println() statements into it and verify what is happening?
For that matter, are there any messages written to the application server's log file?
You're not telling us very much.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
Dumb question that must be asked. You wrote:
Christopher Meadows wrote:The xml file is located at public_html/WEB-INF
public_html is usually used by the Apache web server -- you are trying to run this in Tomcat or some other Servlet engine, right?
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
|
Yes, I am running on with tomcat.
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
|
The /index.html does call a servlet (InfoServlet) and does a quick query and displays the information to http://www.meadowsfuneralhomeinc.com/index.jsp. In the past, I would get an 404 error when the servlet was called. Now, I get a blank page.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56180
|
|
What's expected? Where's the servlet code. Don't make us pull teeth, give us more info.
Have you checked to see if the servlet is running at all? (logging comes in handy)
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
Here is the servlet code
I think I know what might be the problem, I changed the name on the database when I built it on the webserver. I will make the change in my code and compile. I will also reset my tomcat. I will try logging a messeage to see if my servlet is even working. Thank you for the advice. I will post my results.
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
I checked the servlets by writing some test code and the servlets work. My problem must with the database connection. I will investigate further. I would like to thank everyone for their help.
Regards
Chris
|
 |
Christopher Meadows
Greenhorn
Joined: Mar 09, 2010
Posts: 7
|
|
I figured out the problem, I did not have Class.forName in my java file.
It was not required in Netbeans 6.8, thank for everyone's input.
Regards
|
 |
 |
|
|
subject: HTTP Status 404 - Servlet is not available
|
|
|