>Number: 3665
>Category: mod_jserv
>Synopsis: can't start servlets who are compiled in packages(an the
>according subdirs) in the servlet directory
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: jserv
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Thu Jan 14 06:20:00 PST 1999
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: Server version: Apache/1.3.3 (Unix)
>Environment:
SunOS BMZ01FONSNWW02 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-4
gcc , gmake
>Description:
I will use the SimpleServlet as example to explain this.
The setup is as follows
1 servlet zone (divinedevelopment) wo is on the disk in
/devsites/telesales/servlets/
In subdirectory /devsites/telesales/servlets/divine I have a file named
SimpleServlet.java
now look at this:
BMZ01FONSNWW02:/devsites/telesales/servlets# head divine/SimpleServlet.java
package divine;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SimpleServlet extends HttpServlet
so it in pakage divine.
I compile and get a file /devsites/telesales/servlets/divine/SimpleServlet.class
with Apache jserv 0.9 I did
http://10.2.12.151/servlets/divine/SimpleServlet
to get it to work. Now it gives me
the response is
----------
Not Found
The requested URL /servlets/divine was not found on this server.
Apache/1.3.3 Server at testwww16 Port 80
----------
in the log one sees
----------
[14/01/1999 17:20:56:002 GMT+03:30] Connection from localhost/127.0.0.1
[14/01/1999 17:20:56:003 GMT+03:30] Initializing servlet request
[14/01/1999 17:20:56:003 GMT+03:30] Reading request data
[14/01/1999 17:20:56:003 GMT+03:30] Will read 25 bytes for this line
[14/01/1999 17:20:56:003 GMT+03:30] Read: Cdivinedevelopment divine
[14/01/1999 17:20:56:004 GMT+03:30] Servlet Zone: divinedevelopment Servlet:
divine
[14/01/1999 17:20:56:004 GMT+03:30] Will read 10 bytes for this line
[14/01/1999 17:20:56:004 GMT+03:30] Read: Stestwww16
[14/01/1999 17:20:56:004 GMT+03:30] Hostname: testwww16
[14/01/1999 17:20:56:045 GMT+03:30] Will read 34 bytes for this line
[14/01/1999 17:20:56:045 GMT+03:30] Read: EDOCUMENT_ROOT
/devsites/telesales
[14/01/1999 17:20:56:045 GMT+03:30] Env: DOCUMENT_ROOT=/devsites/telesales
[14/01/1999 17:20:56:045 GMT+03:30] Will read 26 bytes for this line
[14/01/1999 17:20:56:045 GMT+03:30] Read: EGATEWAY_INTERFACE CGI/1.1
[14/01/1999 17:20:56:045 GMT+03:30] Env: GATEWAY_INTERFACE=CGI/1.1
[14/01/1999 17:20:56:045 GMT+03:30] Will read 24 bytes for this line
[14/01/1999 17:20:56:046 GMT+03:30] Read: EPATH /usr/sbin:/usr/bin
[14/01/1999 17:20:56:046 GMT+03:30] Env: PATH=/usr/sbin:/usr/bin
[14/01/1999 17:20:56:046 GMT+03:30] Will read 25 bytes for this line
[14/01/1999 17:20:56:046 GMT+03:30] Read: EPATH_INFO /SimpleServlet
[14/01/1999 17:20:56:046 GMT+03:30] Env: PATH_INFO=/SimpleServlet
[14/01/1999 17:20:56:046 GMT+03:30] Will read 50 bytes for this line
[14/01/1999 17:20:56:046 GMT+03:30] Read: EPATH_TRANSLATED
/devsites/telesales/SimpleServlet
[14/01/1999 17:20:56:046 GMT+03:30] Env:
PATH_TRANSLATED=/devsites/telesales/SimpleServlet
[14/01/1999 17:20:56:046 GMT+03:30] Will read 14 bytes for this line
[14/01/1999 17:20:56:046 GMT+03:30] Read: EQUERY_STRING
[14/01/1999 17:20:56:046 GMT+03:30] Env: QUERY_STRING=null
[14/01/1999 17:20:56:046 GMT+03:30] Will read 23 bytes for this line
[14/01/1999 17:20:56:047 GMT+03:30] Read: EREMOTE_ADDR 10.2.1.221
[14/01/1999 17:20:56:047 GMT+03:30] Env: REMOTE_ADDR=10.2.1.221
[14/01/1999 17:20:56:047 GMT+03:30] Will read 17 bytes for this line
[14/01/1999 17:20:56:047 GMT+03:30] Read: EREMOTE_PORT 2617
[14/01/1999 17:20:56:047 GMT+03:30] Env: REMOTE_PORT=2617
[14/01/1999 17:20:56:047 GMT+03:30] Will read 19 bytes for this line
[14/01/1999 17:20:56:047 GMT+03:30] Read: EREQUEST_METHOD GET
[14/01/1999 17:20:56:047 GMT+03:30] Env: REQUEST_METHOD=GET
[14/01/1999 17:20:56:047 GMT+03:30] Will read 43 bytes for this line
[14/01/1999 17:20:56:047 GMT+03:30] Read: EREQUEST_URI
/servlets/divine/SimpleServlet
[14/01/1999 17:20:56:047 GMT+03:30] Env:
REQUEST_URI=/servlets/divine/SimpleServlet
[14/01/1999 17:20:56:047 GMT+03:30] Will read 33 bytes for this line
[14/01/1999 17:20:56:047 GMT+03:30] Read: ESCRIPT_FILENAME /servlets/divine
[14/01/1999 17:20:56:047 GMT+03:30] Env: SCRIPT_FILENAME=/servlets/divine
[14/01/1999 17:20:56:047 GMT+03:30] Will read 29 bytes for this line
[14/01/1999 17:20:56:048 GMT+03:30] Read: ESCRIPT_NAME /servlets/divine
[14/01/1999 17:20:56:048 GMT+03:30] Env: SCRIPT_NAME=/servlets/divine
[14/01/1999 17:20:56:048 GMT+03:30] Will read 38 bytes for this line
[14/01/1999 17:20:56:048 GMT+03:30] Read: ESERVER_ADMIN [EMAIL PROTECTED]
[14/01/1999 17:20:56:048 GMT+03:30] Env: [EMAIL PROTECTED]
[14/01/1999 17:20:56:048 GMT+03:30] Will read 22 bytes for this line
[14/01/1999 17:20:56:048 GMT+03:30] Read: ESERVER_NAME testwww16
[14/01/1999 17:20:56:048 GMT+03:30] Env: SERVER_NAME=testwww16
[14/01/1999 17:20:56:048 GMT+03:30] Will read 15 bytes for this line
[14/01/1999 17:20:56:048 GMT+03:30] Read: ESERVER_PORT 80
[14/01/1999 17:20:56:048 GMT+03:30] Env: SERVER_PORT=80
[14/01/1999 17:20:56:048 GMT+03:30] Will read 25 bytes for this line
[14/01/1999 17:20:56:048 GMT+03:30] Read: ESERVER_PROTOCOL HTTP/1.0
[14/01/1999 17:20:56:049 GMT+03:30] Env: SERVER_PROTOCOL=HTTP/1.0
[14/01/1999 17:20:56:049 GMT+03:30] Will read 78 bytes for this line
[14/01/1999 17:20:56:049 GMT+03:30] Read: ESERVER_SIGNATURE
<ADDRESS>Apache/1.3.3 Server at testwww16 Port 80</ADDRESS>
[14/01/1999 17:20:56:049 GMT+03:30] Env: SERVER_SIGNATURE=<ADDRESS>Apache/1.3.3
Server at testwww16 Port 80</ADDRESS>
[14/01/1999 17:20:56:049 GMT+03:30] Will read 82 bytes for this line
[14/01/1999 17:20:56:049 GMT+03:30] Read: ESERVER_SOFTWARE Apache/1.3.3
(Unix) ApacheJServ/1.0b1 mod_ssl/2.1.5 SSLeay/0.9.0b
[14/01/1999 17:20:56:049 GMT+03:30] Env: SERVER_SOFTWARE=Apache/1.3.3 (Unix)
ApacheJServ/1.0b1 mod_ssl/2.1.5 SSLeay/0.9.0b
[14/01/1999 17:20:56:049 GMT+03:30] Will read 75 bytes for this line
[14/01/1999 17:20:56:049 GMT+03:30] Read: HAccept image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
[14/01/1999 17:20:56:049 GMT+03:30] Header: Accept=image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, image/png, */*
[14/01/1999 17:20:56:049 GMT+03:30] Will read 34 bytes for this line
[14/01/1999 17:20:56:049 GMT+03:30] Read: HAccept-Charset
iso-8859-1,*,utf-8
[14/01/1999 17:20:56:049 GMT+03:30] Header: Accept-Charset=iso-8859-1,*,utf-8
[14/01/1999 17:20:56:049 GMT+03:30] Will read 19 bytes for this line
[14/01/1999 17:20:56:050 GMT+03:30] Read: HAccept-Language en
[14/01/1999 17:20:56:050 GMT+03:30] Header: Accept-Language=en
[14/01/1999 17:20:56:050 GMT+03:30] Will read 22 bytes for this line
[14/01/1999 17:20:56:050 GMT+03:30] Read: HConnection Keep-Alive
[14/01/1999 17:20:56:050 GMT+03:30] Header: Connection=Keep-Alive
[14/01/1999 17:20:56:050 GMT+03:30] Will read 17 bytes for this line
[14/01/1999 17:20:56:050 GMT+03:30] Read: HHost 10.2.12.151
[14/01/1999 17:20:56:050 GMT+03:30] Header: Host=10.2.12.151
[14/01/1999 17:20:56:050 GMT+03:30] Will read 16 bytes for this line
[14/01/1999 17:20:56:050 GMT+03:30] Read: HPragma no-cache
[14/01/1999 17:20:56:050 GMT+03:30] Header: Pragma=no-cache
[14/01/1999 17:20:56:050 GMT+03:30] Will read 57 bytes for this line
[14/01/1999 17:20:56:050 GMT+03:30] Read: HUser-Agent Mozilla/4.04 [en] (X11;
I; Linux 2.0.33 i586)
[14/01/1999 17:20:56:051 GMT+03:30] Header: User-Agent=Mozilla/4.04 [en] (X11;
I; Linux 2.0.33 i586)
[14/01/1999 17:20:56:051 GMT+03:30] All data read.
[14/01/1999 17:20:56:051 GMT+03:30] Parsing cookies
[14/01/1999 17:20:56:052 GMT+03:30] Sending response headers.
[14/01/1999 17:20:56:053 GMT+03:30] Status: 404 Not Found
[14/01/1999 17:20:56:053 GMT+03:30] Servlet-Error: ClassNotFoundException:
divine
-----------
I tried to type
http://10.2.12.151/servlets/divine.SimpleServlet
(which isn't right for me anyway because the program that runs on the machine
is coded to use /divine/SimpleServlet and I can't change the source so
it isn't even an option.)
and the result is
------
Not Found
The requested URL /servlets/divine.SimpleServlet was not found on this server.
Apache/1.3.3 Server at testwww16 Port 80
--------
in the logs some differences
-------
[14/01/1999 17:29:06:362 GMT+03:30] Read: Cdivinedevelopment
divine.SimpleServlet
[14/01/1999 17:29:06:362 GMT+03:30] Servlet Zone: divinedevelopment Servlet:
divine.SimpleServlet
no path info this time
and end result
[14/01/1999 17:29:06:408 GMT+03:30] Sending response headers.
[14/01/1999 17:29:06:408 GMT+03:30] Status: 404 Not Found
[14/01/1999 17:29:06:408 GMT+03:30] Servlet-Error: ClassNotFoundException:
divine.SimpleServlet
-------
>How-To-Repeat:
I think the description explains how to recreate also.
>Fix:
for the problem with the divine.SimpleServlet, I think the
class(re)loader and the names past to it so be checked by you
guys but on the other hand:
I think a good solution for the slash solution whould be, that :
if a servlet can't be loaded and the javaengine can find
a subdir in one of its repositories of the zone, that has
the name of the servlet that cant be found, then get the
first part of the env. path_info(up to the first /), make
path info = current path info-(up to first path info), change
the servlet to be loaded in currentservlet="currentservlet"."(up to first/)"
and try to load this one.
If this fails then recurse previous routine (ofcourse repository should
be a "temp repos" so that one can append the last found directory parth
to it. (or use a var that one automatically appends to the reposit dirs)
say that one can't find the servlet if all / are removed from the path_info
and still no servlet is found.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request ]
[from a developer. ]
[Reply only with text; DO NOT SEND ATTACHMENTS! ]