JSERV servlets in subdirectories not working

JSERV servlets in subdirectories not working

Post by Walter Moor » Fri, 04 Sep 1998 04:00:00



I'm using sunos 5.5, apache 1.2.6, jserv 0.9.11, java 1.1.6.

Accessing a servlet in the directory I have set aside for my servlets
(/opt/local/jserv/installed/servlets) using the web browser
http://www.uld.fedex.com/servlet/SnoopServlet
it works.

But when I try to access SnoopServlet in a subdirectory, it does not
work.
http://www.uld.fedex.com/servlet/examples.SnoopServlet
or
http://www.uld.fedex.com/servlet/examples/SnoopServlet
both give me the same error: 'Internal Server error'.

Here's the jserv_error.log (examples.SnoopServlet is followed
by examples.SnoopServlet, but they appear the same):
===========
[Loaded
/opt/local/jserv/installed/classes/org/apache/jserv/JServConnection.clas
s]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/http/HttpServletRequest
.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/ServletRequest.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/http/HttpServletRespons
e.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/ServletResponse.class]
[Loaded java/io/DataInputStream.class from
/opt/local/java/lib/classes.zip]
[Loaded java/io/DataInput.class from /opt/local/java/lib/classes.zip]
[Loaded java/net/SocketInputStream.class from
/opt/local/java/lib/classes.zip]
[Loaded java/net/SocketOutputStream.class from
/opt/local/java/lib/classes.zip]
[03/09/1998 12:41:45 CDT]: Initializing servlet request
[03/09/1998 12:41:45 CDT]: Reading request data
[03/09/1998 12:41:45 CDT]: will read 10 bytes for this line
[03/09/1998 12:41:45 CDT]: read A213b691e3
[Loaded java/util/NoSuchElementException.class from
/opt/local/java/lib/classes.zip]
[03/09/1998 12:41:45 CDT]: Authorization: 213b691e3
[03/09/1998 12:41:45 CDT]: will read 58 bytes for this line
[03/09/1998 12:41:45 CDT]: read C/opt/local/jserv/installed/servlets  
examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: Servlet: examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: will read 18 bytes for this line
[03/09/1998 12:41:45 CDT]: read Swww.uld.fedex.com
[03/09/1998 12:41:45 CDT]: Hostname: www.uld.fedex.com
[03/09/1998 12:41:45 CDT]: will read 26 bytes for this line
[03/09/1998 12:41:45 CDT]: read EGATEWAY_INTERFACE      CGI/1.1
[03/09/1998 12:41:45 CDT]: Env: GATEWAY_INTERFACE=CGI/1.1
[03/09/1998 12:41:45 CDT]: will read 25 bytes for this line
[03/09/1998 12:41:45 CDT]: read ESERVER_PROTOCOL        HTTP/1.0
[03/09/1998 12:41:45 CDT]: Env: SERVER_PROTOCOL=HTTP/1.0
[03/09/1998 12:41:45 CDT]: will read 19 bytes for this line
[03/09/1998 12:41:45 CDT]: read EREQUEST_METHOD GET
[03/09/1998 12:41:45 CDT]: Env: REQUEST_METHOD=GET
[03/09/1998 12:41:45 CDT]: will read 14 bytes for this line
[03/09/1998 12:41:45 CDT]: read EQUERY_STRING
[03/09/1998 12:41:45 CDT]: Env: QUERY_STRING=null
[03/09/1998 12:41:45 CDT]: will read 43 bytes for this line
[03/09/1998 12:41:45 CDT]: read EREQUEST_URI  
/servlet/examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: Env:
REQUEST_URI=/servlet/examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: will read 43 bytes for this line
[03/09/1998 12:41:45 CDT]: read ESCRIPT_NAME  
/servlet/examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: Env:
SCRIPT_NAME=/servlet/examples.SnoopServlet
[03/09/1998 12:41:45 CDT]: will read 24 bytes for this line
[03/09/1998 12:41:45 CDT]: read EPATH   /usr/sbin:/usr/bin
[03/09/1998 12:41:45 CDT]: Env: PATH=/usr/sbin:/usr/bin
[03/09/1998 12:41:45 CDT]: will read 29 bytes for this line
[03/09/1998 12:41:45 CDT]: read ESERVER_SOFTWARE        Apache/1.2.6
[03/09/1998 12:41:45 CDT]: Env: SERVER_SOFTWARE=Apache/1.2.6
[03/09/1998 12:41:45 CDT]: will read 30 bytes for this line
[03/09/1998 12:41:45 CDT]: read ESERVER_NAME    www.uld.fedex.com
[03/09/1998 12:41:45 CDT]: Env: SERVER_NAME=www.uld.fedex.com
[03/09/1998 12:41:45 CDT]: will read 15 bytes for this line
[03/09/1998 12:41:45 CDT]: read ESERVER_PORT    80
[03/09/1998 12:41:45 CDT]: Env: SERVER_PORT=80
[03/09/1998 12:41:45 CDT]: will read 21 bytes for this line
[03/09/1998 12:41:46 CDT]: read EREMOTE_HOST    walterpc
[03/09/1998 12:41:46 CDT]: Env: REMOTE_HOST=walterpc
[03/09/1998 12:41:46 CDT]: will read 26 bytes for this line
[03/09/1998 12:41:46 CDT]: read EREMOTE_ADDR    146.18.245.20
[03/09/1998 12:41:46 CDT]: Env: REMOTE_ADDR=146.18.245.20
[03/09/1998 12:41:46 CDT]: will read 55 bytes for this line
[03/09/1998 12:41:46 CDT]: read EDOCUMENT_ROOT
/opt/local/http/htdocs/www.uld.f
edex.com
[03/09/1998 12:41:46 CDT]: Env:
DOCUMENT_ROOT=/opt/local/http/htdocs/www.uld.fedex.com
[03/09/1998 12:41:46 CDT]: will read 31 bytes for this line
[03/09/1998 12:41:46 CDT]: read ESERVER_ADMIN   wbmo...@fedex.com
[03/09/1998 12:41:46 CDT]: Env: SERVER_ADMIN=wbmo...@fedex.com
[03/09/1998 12:41:46 CDT]: will read 74 bytes for this line
[03/09/1998 12:41:46 CDT]: read ESCRIPT_FILENAME      
/opt/local/jserv/installed/servlets/examples.SnoopServlet
[03/09/1998 12:41:46 CDT]: Env:
SCRIPT_FILENAME=/opt/local/jserv/installed/servlets/examples.SnoopServlet
[03/09/1998 12:41:46 CDT]: will read 17 bytes for this line
[03/09/1998 12:41:46 CDT]: read EREMOTE_PORT    3993
[03/09/1998 12:41:46 CDT]: Env: REMOTE_PORT=3993
[03/09/1998 12:41:46 CDT]: will read 22 bytes for this line
[03/09/1998 12:41:46 CDT]: read HConnection     Keep-Alive
[03/09/1998 12:41:46 CDT]: Header: Connection=Keep-Alive
[03/09/1998 12:41:46 CDT]: will read 52 bytes for this line
[03/09/1998 12:41:46 CDT]: read HUser-Agent     Mozilla/4.04
[en]C-FedExIntl  (W
in95; I)
[03/09/1998 12:41:46 CDT]: Header: User-Agent=Mozilla/4.04
[en]C-FedExIntl  (Win
95; I)
[03/09/1998 12:41:46 CDT]: will read 23 bytes for this line
[03/09/1998 12:41:46 CDT]: read HHost   www.uld.fedex.com
[03/09/1998 12:41:46 CDT]: Header: Host=www.uld.fedex.com
[03/09/1998 12:41:46 CDT]: will read 75 bytes for this line
[03/09/1998 12:41:46 CDT]: read HAccept image/gif, image/x-xbitmap,
image/jpeg,
image/pjpeg, image/png, */*
[03/09/1998 12:41:46 CDT]: Header: Accept=image/gif, image/x-xbitmap,
image/jpeg
, image/pjpeg, image/png, */*
[03/09/1998 12:41:46 CDT]: will read 19 bytes for this line
[03/09/1998 12:41:46 CDT]: read HAccept-Language        en
[03/09/1998 12:41:46 CDT]: Header: Accept-Language=en
[03/09/1998 12:41:46 CDT]: will read 34 bytes for this line
[03/09/1998 12:41:46 CDT]: read HAccept-Charset iso-8859-1,*,utf-8
[03/09/1998 12:41:46 CDT]: Header: Accept-Charset=iso-8859-1,*,utf-8
[03/09/1998 12:41:46 CDT]: will read 0 bytes for this line
[03/09/1998 12:41:46 CDT]: read
[03/09/1998 12:41:46 CDT]: All data read.
[03/09/1998 12:41:46 CDT]: Parsing cookies
[Loaded
/opt/local/jserv/installed/classes/org/apache/jserv/JServUtils.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/http/Cookie.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/http/HttpUtils.class]
[Loaded
/opt/local/jserv/installed/classes/org/apache/jserv/JServContext.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/ServletConfig.class]
[Loaded
/opt/local/jserv/installed/classes/javax/servlet/ServletContext.class]
[03/09/1998 12:41:47 CDT]: cl#0: Asked to load examples.SnoopServlet
[Loaded
/opt/local/jserv/installed/classes/org/apache/jserv/JServClassLoader$Cla
ssCacheEntry.class]
[Loaded java/util/VectorEnumerator.class from
/opt/local/java/lib/classes.zip]
[03/09/1998 12:41:47 CDT]: cl#0: Loaded class examples.SnoopServlet from
directory servlets
[Loaded java/lang/ClassFormatError.class from
/opt/local/java/lib/classes.zip]
[Loaded java/io/PrintWriter.class from /opt/local/java/lib/classes.zip]
[03/09/1998 12:41:47 CDT]: Sending response headers.
[03/09/1998 12:41:47 CDT]: Status: 500 Internal Server Error
[03/09/1998 12:41:47 CDT]: Servlet-Error: java.lang.ClassFormatError:
Wrong name
: Wrong name
[03/09/1998 12:41:47 CDT]: java.lang.ClassFormatError: Wrong name: Wrong
name
        at java.lang.ClassLoader.defineClass(ClassLoader.java)
        at
org.apache.jserv.JServClassLoader.loadClass(JServClassLoader.java:443
)
        at java.lang.ClassLoader.loadClass(ClassLoader.java)
        at
org.apache.jserv.JServServletManager.loadServlet(JServServletManager.
java:375)
        at
org.apache.jserv.JServConnection.run(JServConnection.java:312)
[03/09/1998 13:04:46 CDT]: Connection from localhost/127.0.0.1
[03/09/1998 13:04:46 CDT]: Initializing servlet request
[03/09/1998 13:04:46 CDT]: Reading request data
[03/09/1998 13:04:46 CDT]: will read 10 bytes for this line
[03/09/1998 13:04:46 CDT]: read A213b691e3
[03/09/1998 13:04:46 CDT]: Authorization: 213b691e3
[03/09/1998 13:04:46 CDT]: will read 58 bytes for this line
[03/09/1998 13:04:46 CDT]: read C/opt/local/jserv/installed/servlets  
examples
.SnoopServlet
[03/09/1998 13:04:46 CDT]: Servlet: examples.SnoopServlet
[03/09/1998 13:04:46 CDT]: will read 18 bytes for this line
[03/09/1998 13:04:46 CDT]: read Swww.uld.fedex.com
[03/09/1998 13:04:46 CDT]: Hostname: www.uld.fedex.com
[03/09/1998 13:04:46 CDT]: will read 26 bytes for this line
[03/09/1998 13:04:46 CDT]: read EGATEWAY_INTERFACE      CGI/1.1
[03/09/1998 13:04:46 CDT]: Env: GATEWAY_INTERFACE=CGI/1.1
[03/09/1998 13:04:46 CDT]: will read 25 bytes for this line
[03/09/1998 13:04:46 CDT]: read ESERVER_PROTOCOL        HTTP/1.0
[03/09/1998 13:04:46 CDT]: Env: SERVER_PROTOCOL=HTTP/1.0
[03/09/1998 13:04:46 CDT]: will read 19 bytes for this line
[03/09/1998 13:04:46 CDT]: read EREQUEST_METHOD GET
[03/09/1998 13:04:46 CDT]: Env: REQUEST_METHOD=GET
[03/09/1998 13:04:46 CDT]: will read 14 bytes for this line
[03/09/1998 13:04:46 CDT]: read EQUERY_STRING
[03/09/1998 13:04:46 CDT]: Env: QUERY_STRING=null
[03/09/1998 13:04:46 CDT]: will read 43 bytes for this line
[03/09/1998 13:04:46 CDT]: read EREQUEST_URI  
/servlet/examples/SnoopServlet
[03/09/1998 13:04:46 CDT]: Env:
REQUEST_URI=/servlet/examples/SnoopServlet
[03/09/1998 13:04:46 CDT]: will read 43 bytes for this line
[03/09/1998 13:04:46 CDT]: read ESCRIPT_NAME  
/servlet/examples/SnoopServlet
[03/09/1998 13:04:46 CDT]: Env:
SCRIPT_NAME=/servlet/examples/SnoopServlet
[03/09/1998 13:04:46 CDT]: will read 24 bytes ...

read more »

 
 
 

JSERV servlets in subdirectories not working

Post by Walter Moor » Fri, 04 Sep 1998 04:00:00


Thanks to Ed Korthof, I can now access classes in subdirs.



>> http://www.uld.fedex.com/servlet/examples.SnoopServlet
>This attempts to load examples.SnoopServlet.  examples is the package
>name, which means that the class file which Java finds must be in that
>package.  Unless you added that line and recompiled SnoopServlet, it
>won't work, since it has no package specification (ie. it's a
>top-level class).
> > [03/09/1998 12:41:47 CDT]: cl#0: Loaded class examples.SnoopServlet
> > from directory servlets
> > [Loaded java/lang/ClassFormatError.class from
> > /opt/local/java/lib/classes.zip]
> Here is the error message which Java give when the package name (from
> the directory from which the file was loaded) does not match the
> package name in the .class file.

I added the line
package examples;
to each *.java in the subdirectory and recompiled.
then I was able to access each *.class in that subdir
using the http://www.uld.fedex.com/servlet/examples.SnoopServlet

I also added them to the servlet.properties file
and now can also access them using the aliases. Example:
http://www.uld.fedex.com/servlet/snoop

thanks again Ed!

Walter

 
 
 

1. jserv for apache : JServUtils.java:66: Class javax.servlet.http.Cookie not found in import.

Hi,

I spent a few hours this afternoon trying to install jserv for apache
(jserv.apache.org), but there is _always_ the same problem during the
"make" :(. I looked on the faq, on deja.com and altavista, without
finding anything useful. Maybe you will be able to tell me where
the problem is ? All the other things are working perfectely (php, ssl, etc.)

System : Suse Linux 6.2, with jdk 1.1.7, JSDK2.0, apache 1.3.9, jserv 1.0
Problem:

Making all in java
make[2]: Entering directory `/usr/local/src/web/ApacheJServ-1.0/src/java'
CLASSPATH=:../JSDK2.0/lib/jsdk.jar:. /usr/lib/jdk1.1.7/bin/javac -g \
                     -deprecation ./org/apache/java/io/LogRecord.java
[ ......... about 15 lines deleted ............... ]
CLASSPATH=:../JSDK2.0/lib/jsdk.jar:. /usr/lib/jdk1.1.7/bin/javac -g \
                      -deprecation ./org/apache/jserv/JServUtils.java
./org/apache/jserv/JServUtils.java:66: Class javax.servlet.http.Cookie not
found in import.

import javax.servlet.http.Cookie;
       ^
1 error
make[2]: *** [org/apache/jserv/JServUtils.class] Error 1

Voila, You know everything now... Thanks in advance for any hint!
Olivier

--
____________________________________________________________
    --- .-.. .. ...- .. . .-.    -- ..- .-.. .-.. . .-.

2. sparc-solaris2.2: netgroups & share??

3. apache, jserv, servlet to DB doesn't work

4. Has anyone gotten a SIIG Soundwave 1000 Soundcard to work under Linux?

5. Apache/JServ does not update servlets

6. ftp problems

7. Apache/Jserv/Servlets/Memory

8. how to handle programmers who want to write in /usr/local/include?

9. Apache Jserv - Servlet question

10. How to configure Jserv for user servlets?

11. Problem with Apache+JServ+Servlets delivering gzipped Files

12. Apache 1.3.3 w/ JServ: Servlet-Error.

13. HELP!? Servlet logs on apache/JServ