You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Hoepfner-Homme <pa...@oven.com> on 2000/10/05 21:36:14 UTC
Can't figure out how get a servlet to run!
Hi, list,
I got a webmail application called Saké Mail that I am trying to install
onto my Tomcat server (it's servlet-based). I've had no trouble install
it onto other Java servlet runners (like JServ and ATG Dynamo) but those
runners only support the 2.0 servlet specification apparently, and this
webmail app needs a runner that is at least 2.1-compliant (which Tomcat
is). I managed to get those runners to find and run the servlet, but it
gave errors because they weren't 2.1-compliant, so that's when I
realized I needed Tomcat.
So I installed Tomcat and set it up to work with Apache (running under
Red Hat 6.1). I know Tomcat is installed correctly because I've been
able to successfully run all of the JSP and Servlet examples. However,
I can't for the life of me figure out how to get Tomcat to connect to my
webmail servlet. Here's a summary of what I am supposed to do to
install Saké Mail (according to the instructions that came with it):
1. Add Sake jar file to the classpath. The jar file is in
/usr/local/sake/sake.jar. I've configured Tomcat so that when it starts
up and displays its classpath, this path is listed along in it (it took
me a while to figure out how to do this, but I did it).
2. Tell Sake where it is located. All that I need to do for this is
make sure the Sake directory tree is installed in /usr/local/sake (and
it is) so that's no problem.
3. Create a web server alias that maps /usr/local/sake/templates to the
URL location /templates. EASY.
4. Test the installation. To do this, I go to
http://<servername>/servlet/com.endymion.sake.servlet.mail.MailServlet
The last step doesn't work (404). In fact, nothing that's of the form
http://<servername>/servlet/... works. There's no such think as
/servlet, in fact. There is, however, such thing as /examples/servlet,
because that's how all of the example servlets that came with Tomcat
worked.
I've spent a long time trying to figure out how to get this working on
my own, but I must not be creative enough ;)
Does anyone have any insight for me?
Thanks,
Paul
--
Paul Hoepfner-Homme
paulh@oven.com
OVEN Digital | http://www.oven.com/
Re: Can't figure out how get a servlet to run!
Posted by Paul Hoepfner-Homme <pa...@oven.com>.
Christoph Schaper wrote:
>
> Paul Hoepfner-Homme wrote:
>
> > I got a webmail application called Saké Mail that I am trying to install
> > onto my Tomcat server (it's servlet-based). I've had no trouble install
> > it onto other Java servlet runners (like JServ and ATG Dynamo) but those
> > runners only support the 2.0 servlet specification apparently, and this
> > webmail app needs a runner that is at least 2.1-compliant (which Tomcat
> > is). I managed to get those runners to find and run the servlet, but it
> > gave errors because they weren't 2.1-compliant, so that's when I
> > realized I needed Tomcat.
>
> If your servlet needs at least a 2.1 compliant engine but you could
> install
> it on an engine that isnt ????? how did you do that ?
Well all I did was follow the instructions that came with the webmail
client - there's nothing in those instructions that specific to 2.0 or
2.1 or any other version of the servlet specification. When I went to
run the servlet, it just displayed a NullPointerException in the doGet
method, and the makers of the webmail client said this is characteristic
of me trying to run it on a 2.0 servlet runner.
> put your jar file under your webapps/ROOT/lib dir
> put your classes under webapps/ROOT/WEB-INF/classes/
> and maybe read the docs and readmes
I've been reading the docs and readmes extensively. I've tried putting
it in /ROOT/lib, but it just says it can't find the class (though I
ensured that the JAR file was in my CLASSPATH too, even though that's
supposedly not necessary...). There's nothing to put in the /classes
dir, it's all in a JAR file. The main class that I'm calling is in the
JAR file. Is this the reason I can't run it, do you think?
> work on your server.xml and your web.xml
ok...
> sorry but you dont really make sense
Please show me where I don't make sense. Most of what I wrote was
directly from the instructions from the webmail software. I was trying
to be very clear (though I am a newbie with Tomcat, so try to understand
my words from a newbie's point of view).
> > The last step doesn't work (404). In fact, nothing that's of the form
> > http://<servername>/servlet/... works. There's no such think as
> > /servlet, in fact. There is, however, such thing as /examples/servlet,
> > because that's how all of the example servlets that came with Tomcat
> > worked.
> You can "alias servlets in your web.xml under WEB-INF
> example :
> <web-app>
> <servlet>
> <servlet-name>Servlet1</servlet-name>
> <servlet-class>Servlet1</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>Servlet1</servlet-name>
> <url-pattern>/HelloWorld.htm</url-pattern>
> </servlet-mapping>
> </web-app>
>
> so something like http://myserver.com/servlet/Servlet1 becomes
> http://myserver.com/HelloWorld.htm
OK, I guess I should try that then.
Thanks
> -
> ---------------------------------------
> Christoph Schaper
> email :christoph@schaper.org
> homepage http://schaper.org/christoph
> http://schaper-edv.de
> ---------------------------------------
--
Paul Hoepfner-Homme
paulh@oven.com
OVEN Digital | http://www.oven.com/
Re: Can't figure out how get a servlet to run!
Posted by Christoph Schaper <ch...@schaper.org>.
Paul Hoepfner-Homme wrote:
> I got a webmail application called Saké Mail that I am trying to install
> onto my Tomcat server (it's servlet-based). I've had no trouble install
> it onto other Java servlet runners (like JServ and ATG Dynamo) but those
> runners only support the 2.0 servlet specification apparently, and this
> webmail app needs a runner that is at least 2.1-compliant (which Tomcat
> is). I managed to get those runners to find and run the servlet, but it
> gave errors because they weren't 2.1-compliant, so that's when I
> realized I needed Tomcat.
If your servlet needs at least a 2.1 compliant engine but you could
install
it on an engine that isnt ????? how did you do that ?
put your jar file under your webapps/ROOT/lib dir
put your classes under webapps/ROOT/WEB-INF/classes/
and maybe read the docs and readmes
work on your server.xml and your web.xml
sorry but you dont really make sense
> The last step doesn't work (404). In fact, nothing that's of the form
> http://<servername>/servlet/... works. There's no such think as
> /servlet, in fact. There is, however, such thing as /examples/servlet,
> because that's how all of the example servlets that came with Tomcat
> worked.
You can "alias servlets in your web.xml under WEB-INF
example :
<web-app>
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/HelloWorld.htm</url-pattern>
</servlet-mapping>
</web-app>
so something like http://myserver.com/servlet/Servlet1 becomes
http://myserver.com/HelloWorld.htm
-
---------------------------------------
Christoph Schaper
email :christoph@schaper.org
homepage http://schaper.org/christoph
http://schaper-edv.de
---------------------------------------