Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) Configuration :
(EMERGENCY) ajp11: can not connect to host 127.0.0.1:8007, (ERROR) an error returned handling request via protocol "ajpv11"
----------
From: "jon *" jon@clearink.com
To: Java Apache Users java-apache-users@list.working-dogs.com
Date: Fri, Jun 11, 1999, 11:27 AM

> In the mod_jserv.log file, I get :
> (EMERGENCY) ajp11: can not connect to host 127.0.0.1:8007
> (EMERGENCY) ajp11: connection fail
> (ERROR) an error returned handling request via protocol "ajpv11"

That error that you are getting is a result of the JVM not being able to
start up properly. The error is the mod_jserv C portion of Apache JServ not
being able to connect to the running Servlet Engine java portion of the
process.

So, you need to figure out why the JVM is not starting up properly. Make
sure that all of your paths in all of your configuration files are correct.
On Win32 machines, this could mean that it is an issue of having spaces in
your paths. Try setting things up so that there are no spaces anywhere in
any of your paths. Make sure that the path to the JVM binary executable is
correct in your jserv.properties file. Make sure that your wrapper.classpath
has the correct paths to the JSDK and the ApacheJServ.jar file.

Make sure that your permissions are set properly on your log files so that the
userid that the httpd runs under can write to them.

-jon
Another thing to look at is the error.log.
Unless the jserv.log file is happy, the jserv engine will throw an error and write out a stack trace to the error.log.
In my case the problem that stopped the jserv engine from starting was a problem with the name/access of the jserv.log file. Even though the log file seems to be specified in both the jserv.properties and the jserv.conf files, the one that appears to be important to the start up is the one in jserv.properties.

I found the *ONE* spot where you'll need to change the configuration for this particular error:
In httpd.conf, make sure you've put the proper hostname for ApJServDefaultHost! If Apache, etc. are configured for a hostname other than "localhost", you've got to make sure JServ can find the same host.
(This cost me almost two days.)
I managed to solve this problem (which totally prevents JServ from working on win95) by re-installing both Apache, and ApacheJserv is directories which didnt have spaces in the full paths. The standard is "Program Files". Moving both to "ApacheGroup" appears to have worked quite well.
I had this problem after it had been working fine the day before. I had not rebooted the machine in the meantime or anything (Win95+Apache1.3.6+JDK1.2+JServ1.0). I just didn't have the stomach to do a reinstall yet, so I first made sure the equivalent 8.3 names were used for all directories/files in the httpd.conf, mod_jserv.conf, jserv.properties, and zone.properties files. This seemed to work.
I also lost almost 2 days on this problem. I found that the problem was caused because I did not configure a full path to the log file in jserv.properties. [I am using HPUX 10.20, JServ 1.0, w/ Stronghold]
# Set the name of the trace/log file. To avoid possible confusion about # the location of this file, an absolute pathname is recommended. # On Unix, this file must have write permissions by the owner of the JVM # process. In other words, if you are running Apache JServ in manual mode # and Apache is running as user nobody, then the file must have its # permissions set so that that user can write to it. # Syntax: log.file=<log file name> (String) # Default: NONE log.file=/you/must/use/a/full/path/and/it/tells/you/jserv.log
Many thanks to this FAQ for getting me going in the right direction.
Someone way back when set the environment variable JAVA=/usr/java in the .tcshrc file.
This caused both jserv.properties:wrapper.bin to be set to /usr/java and the JAVA variable in all the jserv Makefiles, most notably, the example/Makefile, to be misconfigured. All makefiles need JAVA set to /usr/bin/java (or wherever your java executable is), likewise with the jserv.properties:wrapper.bin
If you do have to make that change, you will have to re-make both jserv and Hello. To re-make Hello, go to the example direcotry, fix the JAVA variable, make clean (to remove the old copy), and make. It would probably be a good idea to re-make all of jserv, but just remaking Hello got me past the (EMERGENCY) error.
-David Schlussel dschluss@slip.net

using blackdown java (1.2pre2) and apache 1.3.6, i found it necessary to set

wrapper.classpath=/path/to/java/jre/lib/rt.jar

(in addition to)
wrapper.classpath=/path/to/jserv/lib/ApacheJServ.jar
wrapper.classpath=/path/to/jsdk/lib/jsdk.jar

in the servlet.properties file. w/o the classpath to rt.jar, the thing
blows up everytime.
I've got similar error, on my machine which is using SunOS 5.6 (Solaris 2.6 ).  I was using jdk1.2.1 and was 
getting this message in my error_log  :
----------
You must install a Solaris patch to run this version of the Java runtime.
Please see the README and release notes for more information.
Exiting.
----------
When  I switch from jdk1.2.1 to 1.1.6  everything worked fine.
If you do specify a "log.file" & make sure it is writable by the running
process, the org.apache.jserv.JServ will not be able to start up and
will not be listening on 8007 for requests. There will be little or no
indication of this state of affairs in the log file, so be careful!

Hint: the first error you will get in this situation is "(EMERGENCY)
ajp11: can not connect to host 127.0.0.1:8007" when you try to hit a
servlet.
I have tried all things mention here but I still got 
 ajp11: cannot connect ot host 127.0.0.1:8007
Breifly:
my jserv.log is owned by nobody.
I can su to nobody and run jserv manually.
all classpath and path are correct.

What's wrong here.
This is my platform:
Redhat 6.0 with Linux kernel 2.2.5
Apache 1.3.9 and Jserv 1.0
Sunsoft JSDK 2.0
This error message on my Sun using AJ1.0/apache1.3.9/jdk1.1.7 seemed to be the result of configuration-mistakes:
1. The complete-path(!) name to the log-file must be the same in jserv.log and jserv.properties,
   and the file must be writeable. I changed mode to 777, perhaps this was too much.
2. security.allowedAddresses had to be the real name (not localhost or 127.0.0.0)
After these changes JServ started.
[05/10/1999 16:47:46:918] (EMERGENCY) ajp11: can not connect to host 127.0.0.1 :8007 [05/10/1999 16:47:46:918] (EMERGENCY) ajp11: connection fail [05/10/1999 16:47:46:918] (ERROR) an error returned handling request via proto col "ajpv11" [05/10/1999 16:47:46:918] (ERROR) an error returned handling request via proto col "status" Above error I am getting in my log file after doing all the setup mentioned in this FAQ. I am using RH 6.0 with Apache 1.3.6-7 and Jserv 1.0 and JSDK 2.0 and JDK i had installed through rpm jdk-sn-1.1.6-1.2glibc. I am able to visit the usr http://localhost/status/jserv but when i thry to visit url ajpv11:/localhost:8007 it says internal error occured. where can be the problem?

Hope this saves someone some time... I just encountered this error again (Linux 2.0.36), and the problem was that the loopback device itself was not configured: JServ couldn't connect to 127.0.0.1:8007 because 127.0.0.1 wasn't reachable (I couldn't even ping it). I don't know what happened to change this, but the following got it going again:
# Attach the loopback device and add route /sbin/ifconfig lo 127.0.0.1 /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

lyonbfATornlDOTgov
same problem for me.
After some try-error, i've put "ApJServLogLevel debug" in jserv.conf , after
that in mod_jserv.log appears:
..... [18/10/1999 22:41:03:011] (INFO) wrapper: Java VM died 5 times in a row with
less than 120 seconds between successive failures, setting delay to 60 seconds
before restarting. Check the Apache error log and the Apache JServ
log files for more details; for maximum log information be sure to
enable the Apache JServ log file in the main jserv properties file by: setting
the 'log' property to true, the 'log.file' property to a file
writable by the uid as whom Apache JServ is run, and by enabling log channels
using the 'log.channel.*' properties)

[18/10/1999 22:41:51:170] (INFO) wrapper: Java VM restarting (PID=5177)
[18/10/1999 22:41:51:172] (INFO) wrapper: Java VM spawned (PID=5215, PPID=5177)
[18/10/1999 22:41:51:174] (INFO) wrapper: Java Virtual Machine unable to start (ERR=2: No such file or directory)
[18/10/1999 22:41:51:174] (ERROR) wrapper: printing debugging information (command line, env)
.....

The message :(ERR=2: No such file or directory)

reminds me to check the executable java path. On rh-6.0 it's /usr/bin/java & not /usr/local/java/bin/java as in the default installed files.

After changing the java executable path in jserv.properties, all OK!

tronyATlaofficesDOTcom
Hello

I continually received this error until
I changed the version of the JSDK I using.

Good luck.
deepaksharma_98ATyahooDOTcom

[Append to This Answer]
Previous: (Answer) Environment Variables
Next: (Answer) How to use a servlet to protect a directory.
This document is: http://java.apache.org/faq/?file=222
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.