You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ra...@radek.asi.pwr.wroc.pl on 2000/01/09 00:01:41 UTC

It doesn't start at all :((((

I propose addition to Tomcat-HOWTO:

1) In point "Testing configuration" there is:
"* Try http://<hostname>/examples -- you should see the Tomcat
examples."

It doesn't work because of:
    - there is no instruction for copying example files into www root
directory, so we should add into poin 2.3 line:
	* Copy example files: cp /path/to/html-files-root/examples/*
/path/to/apache1.3.9/html/examples/

    - but there is no index.html file to view, so it should be done too.

2) I'v done it but servlets reffered from 
http://localhost/examples/jsp/index.html will not work. In added
mod_jserv.log file I'v found:
[08/01/2000 22:34:27:123] (EMERGENCY) ajp12: can not connect to host
127.0.0.1:8007
[08/01/2000 22:34:27:123] (EMERGENCY) ajp12: connection fail
[08/01/2000 22:34:27:123] (ERROR) an error returned handling request via
protocol "ajpv12"

Why? Why in HOWTO there is nothing about JServ zones or java properties? 
My old servlets will not work too, even copyied in any possible
correct location.

Please help, I'm installing Tomcat with and without JServ standard
instalation from 3 days and I'v nothing done yet :(((

Radoslaw Wisniewski
----------------------------------------
Akademickie Stowarzyszenie Informatyczne
Politechnika Wroclawska
----------------------------------------



Re: It doesn't start at all :((((

Posted by Wong Kok Wai <wo...@pacific.net.sg>.
Hey,

Just tried Tomcat 3.0 on a Mac (MRJ 2.1.4) and it works! Except for some
exception stack traces, I've managed to run the JSP and servlet examples.
What surprised me is the generated JSP can be compiled without having the
"tools.jar" from JDK 1.2. Must be something in Apple's MRJ that's the same
as Sun's.




Re: It doesn't start at all :((((

Posted by Jim Rudnicki <jd...@pacbell.net>.
> 1) In point "Testing configuration" there is:
> "* Try http://<hostname>/examples -- you should see the Tomcat
> examples."
>
> It doesn't work because of:
>     - there is no instruction for copying example files into www root
> directory, so we should add into poin 2.3 line:

You do not have to copy the files.  It worked for me first time.

in the server.xml file, you should see an entry:

<Context path="/examples" docBase="examples" defaultSessionTimeOut="30"
isWARExpanded="true" isWARValidated="false" isInvokerEnabled="true"
isWorkDirPersistent="false"/>

This allows the path examples to work just as it is.



Re: It doesn't start at all :((((

Posted by "Zacharias J. Beckman" <zb...@creativesun.com>.
radek@radek.asi.pwr.wroc.pl wrote:

>         * Copy example files: cp /path/to/html-files-root/examples/*
> /path/to/apache1.3.9/html/examples/

No need. As someone else pointed out, the examples work without copying.
This is because the server.xml file specifies a "context" called
"/examples." The context is in essence redirected to Tomcat; that's the
purpose of declaring the context. You can create  your own contexts and
point them to whever you like in your filesystem. For example, I have:

<Context path="/common" docBase="/httpd/common" defaultSessionTimeOut="30"
isWARExpanded="true" isWARValidated="false" isInvokerEnabled="true"
isWorkDirPersistent="false"/>

Also, once you create a context you have to mount it in Apache, using
ApJservMount. For example:

apJservMount /common /common

That will allow me to write "http://www.foo.com/common/<whatever>" to reach
things in the common directory. The ../tomcat/etc/tomcat.conf file mounts a
couple of contexts by default (among them, the /examples context).

>     - but there is no index.html file to view, so it should be done too.

Well, this is one place where it starts to look different from a typical web
server. You should read the various servlet specifications from Sun to get a
better understanding. Unfortunately, after you read them  you'll probably
have more questions than you do now.

The index.html file you're looking for is inside the examples directory,
inside the tomcat installation directory (recall the "/examples" context
points to the "examples" directory--it's relative to the root of the
installation). If you look in there, you'll find various HTML files, as well
as some interesting things to look at inside the WEB-INF directory. The
latter describes your servlets, etc.

> [08/01/2000 22:34:27:123] (EMERGENCY) ajp12: can not connect to host
> 127.0.0.1:8007
> [08/01/2000 22:34:27:123] (EMERGENCY) ajp12: connection fail
> [08/01/2000 22:34:27:123] (ERROR) an error returned handling request via
> protocol "ajpv12"

If you are running Apache 1.3.9 with the default settings (e.g.: on port 80,
etc.) and you didn't modify the Tomcat installation, this should be working.
Check to make sure your httpd.conf file is including the right
../tomcat/etc/tomcat.conf configuration. Also make sure that you have the
correct mod_jserv.so installed in your modules directory for Apache (you can
download it from the Jakarta web site). I'm not certain, but the above could
be caused by not having mod_jserv.so loaded. Also you'll have to have DSO
support enabled on your Apache, or you'll have to recompile it with
mod_jserv built in.

> Why? Why in HOWTO there is nothing about JServ zones or java properties?

The HOWTO is useless.

Eventually, when I've developed a good enough understanding of how Tomcat
really works, I'll take a stab at writing something (if someone doesn't beat
me to it). Right now, I don't understand it quite well enough.
--
Zacharias J. Beckman - zbeckman@creativesun.com - (U.S.) 305-281-8701
Creative Sun Inc., Publishing for the Internet - http://www.creativesun.com

Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits who
neither enjoy nor suffer much, because they live in the gray twilight that
knows neither victory nor defeat. -- Theodore Roosevelt


Re: It doesn't start at all :((((

Posted by Jonathan Reichhold <jo...@objectpublish.com>.
> 2) I'v done it but servlets reffered from
> http://localhost/examples/jsp/index.html will not work. In added
> mod_jserv.log file I'v found:
> [08/01/2000 22:34:27:123] (EMERGENCY) ajp12: can not connect to host
> 127.0.0.1:8007
> [08/01/2000 22:34:27:123] (EMERGENCY) ajp12: connection fail
> [08/01/2000 22:34:27:123] (ERROR) an error returned handling request via
> protocol "ajpv12"
>
> Why? Why in HOWTO there is nothing about JServ zones or java properties?
> My old servlets will not work too, even copyied in any possible
> correct location.

I've had the same problem (and warning) and found that I had to start Tomcat
after I had configured the Apache server as mentioned in the Tomcat-HOWTO
FAQ (and restarted it).  Unless there is something interesting in the
Tomcat/Apache config that I didn't figure out, Tomcat isn't started by the
Apache startup.  I created a simple script which launched Apache and then
starts Tomcat.  This worked great for me and now i have full connectivity of
both my web pages and the jsp/servlets that I've got on my system.

Is this what was planned, or is there something broken in the current builds
of tomcat so I have to start both seperately?  I'm about to go digging in
the code to find this, but I'd love someone who has knowledge of this to
point me toward the correct class (I'm a programmer, just new to this code
base)

A note on your old servlets it that you will need to read the comments about
installing them in the correct folder and modifiying the correct web.xml
file to alias them correctly.  I put my servlets in
/path/to/tomcat/examples/web-inf/classes and everything worked when I
modified the web.xml file at /path/to/tomcat/examples/web-inf correctly.