W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 1998

Re: [Help] Jigsaw 2.0beta2 and servlets & cgi-bin connfig

From: Tarang Kumar Patel <mombasa@ptolemy.arc.nasa.gov>
Date: Thu, 16 Jul 1998 12:09:29 -0400 (EDT)
Message-Id: <199807161607.JAA11059@kilimanjaro.arc.nasa.gov>
To: Benoit.Mahe@sophia.inria.fr
CC: www-jigsaw@w3.org, mombasa@ptolemy.arc.nasa.gov
>>>>> On Thu, 16 Jul 1998 10:36:55 +0200, Benoit Mahe <Benoit.Mahe@sophia.inria.fr> said:

 Benoit

    >> So I have one problem, which I suspect someone will able toquickly
    >> point out the problem. I configured my WWW/servlets directory, placed a
    >> SessionServlet.class and a SnoopServlet.class as delivered with
    >> JSDK2.0. Whe n I attempt to run the either of these servlets I get the
    >> following error on t he output stream.
    >> 
    >> java.lang.ClassFormatError: Duplicate name at
    >> java.lang.ClassLoader.defineClass(ClassLoader.java:228) at
    >> java.lang.ClassLoader.defineClass(ClassLoader.java:206) at
    >> org.w3c.jigsaw.servlet.LocalServletLoader.loadClassFile(LocalServl

    Benoit>  Very strange error, never seen that before (in Jigsaw servlets).
    Benoit> does it happens with every servlet? Did you test these servlets
    Benoit> with the servletrunner? Which jdk are you using? Can you give me
    Benoit> more details?

    I am using JDK 1.1.3, however this is on an IRIX os. So it arrives from SGI
    seeing that Sun don't supply an IRIX installation.

    Yes this happens with every servlet, well I tried just the 3 example
    servlets which arrive with JSDK2.0. The three servlet classes I attempted were :

    SnoopServlet.class
    SessionServlet.class
    SimpleServlet.class

    If the trace back is reoporting the correct line numbers, which I assume
    it is as haven't seen a problem with that before. Then, the interesting
    thing is that all servlet failures are with the same java error, as above. In each
    case this happens to be in "doGet" method and all at the very first
    out.println(...); statement. So the context it would be in is:

    response.setContentType("text/html");
    // then write the data of the response
    out = response.getWriter();
    
    out.println(".....");

    Note ...... is what ever the Tag text string happens to be.

    I know whats this to do with ClassLoader ?, well I couldn't see it from
    the source code either.
 
    >>  If you are wondering what my CLASSPATH has then it is set to
    >> following:
    >> 
    >> CLASSPATH=.:/usr/java/classes:/usr/local/JClasses/jsdk.jar:/usr/local/JClasse
    >> s/jigsaw.zip
    >> 
    >> Apart from this can some one please answer the following questions :
    >> 
    >> [Q] In order to make use of a servlet files, do I have to configure
    >> each fil e in my WWW/servlets directory with
    >> org.w3c.jigsaw.servletServletWrapper frame ?

    Benoit>  What is a servlet file? is it the class file? I'm not sure to
     A class file.

    Benoit> understand your question.  You can configure it by hand, but you
    Benoit> can also create a servlet indexer.

    >>  Is there a way to have an indexer that the servlets directory is
    >> resourced to.

    Benoit>  Yes you can configure an indexer in order to index all .class
    Benoit> files to a ServletWrapper (with a servletWrapperFrame). see [1]

    Thats just it, not all .class files are "servlets".

    Wouldn't it be easier just to have just a directory Frame and not
    have to bother with servletWrapper, as else any time a new servlet class
    is copied into servlets/ directory one has to manage it from JigAdmin
    prior to having the servlet available.

    >>  [Q] How do I get my cgi-bin configured ?
    >> 
    >> I mean I have configured this with the CgiFrame, added a cgi perl
    >> script (counter.pl) in this directory but am unable to have that script
    >> execute d. I get no errors and instead the browser pops me into the
    >> WWW/cgi-bin directory, and it only list the default "empty.txt" file in
    >> its menu.
    >> 
    >> [Q] Why does the cgi script that I have added to WWW/cgi-bin not show
    >> up as a list of files under
    >> 
    >> space | .  .  ---cgi-bin
    >> 
    >> When I open this folder in JigAdmin.
    >> 
    >> [Q] Do I have to Wrap the cgi script, much like the Servlet wrapper ?

    Benoit>  Yes, but you can create a cgi-indexer that create a
    Benoit> FileResource+CGIFrame for each file in WWW/cgi-bin (see [1])

    Same issues here as for servletWrapper i.e why not just have a
    CGIdirectoryFrame take care of all files under that directory.

    Yes, I forgot about that. So I did this and then I come across the
    following error:

    (On my browser) "CGI error: unable to parse script headers."
	
    (In stdout) "org.w3c.jigsaw.frames.CgiFrame@/cgi-bin/counter.pl: http://..../cgi-bin/counter.pl: emited invalid output [expecting :(58) got <FF>(-1)
context: 
]"

    Then I ask the following questions

    [Q] What of a mime-type file configuration ?

        Is this required or is this essentially managed by indexer
        configuration ?

    The reason I ask this is because the above cgi-bin script has the
    following returning header

    "Content-type: image/x-xbitmap\n\n";

    Of course, I haven't set up anything for this content type.

    >> [Q] How does one switch off BROWSING some directories such as :
    >> 
    >> servlets/ cgi-bin/
    >> 
    >> The attributes have a "Browsable" radio button but it doesn't appear to
    >> do what I thought.

    Benoit>  BROWSE is a special method of aolpress brother, not really
    Benoit> useful.  Don't take care about that.

    So what does ?

    As one wouldn't want users to discover the names of cgi-bin scripts by
    traversing the cgi-bin directory.

    Many thanks for the prompt response.

    I'll try and install the same configuration on a Sun Solaris machine to
    see if I manage to resolve the problem.
 
    Tarang
Received on Thursday, 16 July 1998 12:58:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:27 GMT