Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 26th, 2003, 05:52 AM
craigangus craigangus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 6 craigangus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Problems getting servlets to work on Tomcat 4

I am having problems getting servlets to work on my host server.

I am using apache/tomcat 3 as my development server and the host is using apache/tomcat 4.

They have setup tomcat to pick up servlets in the following folder

www.drumpellier.com/public_html/jserv

I have tried putting a simple HelloWorld servlet in

http://www.drumpellier.com/public_h...EB-INF/classes/

folder which worked fine, but when I upload the my files to the server I cant get any servlets to work.

I am hitting a servlet called Controller from the following link.

http://www.drumpellier.com/jserv/se...ller?HsMethod=1

Which then produces the following error

************************************************

HTTP Status 404 - /jserv/servlet/com.golfclub.Controller

With the description as:

description The requested resource (/jserv/servlet/com.golfclub.Controller) is not available

************************************************

The servlet is in the following folder:

http://www.drumpellier.com/public_h...ontroller.class

and the web.xml is in the following folder

http://www.drumpellier.com/public_h...WEB-INF/web.xml

the web.xml referring to this servlet is as follows

************************************************

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>com.golfclub.Controller</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>/com.golfclub.Controller</url-pattern>
</servlet-mapping>
</web-app>

**************************************************

I just want to make sure that everything I have done is correct.

I think the host may not be picking up the com, golfclub, folders, but I’m not sure.

Would it be better to create a war file and put it in the classes folder?

Any help greatly appreciated as Im totally stuck!

Craig

Reply With Quote
  #2  
Old March 26th, 2003, 04:53 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
You can only request servlets by class if the server has an InvokerServlet loading. Some do, some don't. The InvokerServlet allows you to request servlets by using the
Code:
www.hostname.com/servlet/package.to.servlet.className
convention. Since that is how you are requesting it, maybe theirs does not have this InvokerServlet enabled.

However, you should not need it. You have a url mapping specified in the web.xml. You should be able to request the servlet using the url
Code:
http://www.drumpellier.com/jserv/com.golfclub.Controller?HsMethod=1

assuming 'jserv' is the context root they have you set up under. You could change the url for this servlet to
Code:
http://www.drumpellier.com/jserv/Controller?HsMethod=1

by changing the web.xml to read:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>com.golfclub.Controller</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>/Controller</url-pattern>
</servlet-mapping>
</web-app>

HTH

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Problems getting servlets to work on Tomcat 4


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway