You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Fran Fabrizio <ff...@mmrd.com> on 2000/11/22 18:34:25 UTC

Automatic updating of classpath

Isn't Tomcat supposed to automatically add the WEB-INF/classes/
directory to it's classpath under Linux?  I thought I remember reading
that, but so far, I've had to explicitly add it every time.  I hadn't
thought much of it, but a co-worker just came to me with the same
complaint.  What's the real story on this?

Thanks,
Fran


Re: Unloading classes

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Naren Dasu wrote:

> Hi All,
>
> Was trying to understand how classes can loaded and unloaded ?  Is is
> possible to unload classes ? Could someone point me on in the right direction.
>

The short answer is that there is no way in Java to unload and replace individual
classes.  This is based on what a java.lang.ClassLoader provides in terms of API.

What most servlet containers do (when they implement automatic reloading) is
provide a mechanism to throw away the class loader used for the entire web
application (and therefore all the objects created by classes that were loaded by
that class loader).  This causes particular problems when you are talking about
classes found on the system classpath (which, by definition, *cannot* be thrown
away and reloaded.

For a more detailed understanding of what Tomcat does, you really need to dig in
to the source code for whichever Tomcat version you are concerned with.

>
> thanks in advance
> naren
>

Craig McClanahan



Unloading classes

Posted by Naren Dasu <na...@divatv.com>.
Hi All,

Was trying to understand how classes can loaded and unloaded ?  Is is
possible to unload classes ? Could someone point me on in the right direction.

thanks in advance
naren


At 11:25 AM 11/22/00 -0800, Craig R. McClanahan wrote:
>Fran Fabrizio wrote:
>
>> Isn't Tomcat supposed to automatically add the WEB-INF/classes/
>> directory to it's classpath under Linux?  I thought I remember reading
>> that, but so far, I've had to explicitly add it every time.  I hadn't
>> thought much of it, but a co-worker just came to me with the same
>> complaint.  What's the real story on this?
>>
>
>Tomcat makes the classes under WEB-INF/classes available to that web
>application, but it does *not* do so by modfiying the CLASSPATH.  It makes
sense
>when you think about it -- the class path is global to the entire JVM which
>Tomcat runs in, while the classes available to each web app are different.
>
>Tomcat accomplishes what it does by creating a customized class loader for
each
>web application.  This class loader is told to look for classes under
>WEB-INF/classes or in JAR files under WEB-INF/lib.
>
>>
>> Thanks,
>> Fran
>>
>
>Craig McClanahan
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: general-help@jakarta.apache.org
>
>

Re: Automatic updating of classpath

Posted by June Lee <li...@mes.nju.edu.cn>.
It seems can't! You can add the classpath specification in /etc/profile, If
you use Linux

Lee
----- Original Message -----
From: "Fran Fabrizio" <ff...@mmrd.com>
To: <ge...@jakarta.apache.org>
Sent: Thursday, November 23, 2000 1:34 AM
Subject: Automatic updating of classpath


>
> Isn't Tomcat supposed to automatically add the WEB-INF/classes/
> directory to it's classpath under Linux?  I thought I remember reading
> that, but so far, I've had to explicitly add it every time.  I hadn't
> thought much of it, but a co-worker just came to me with the same
> complaint.  What's the real story on this?
>
> Thanks,
> Fran
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>


problem on TOMCAT_HOME

Posted by THE PRINCE <rv...@dnm.it>.
hi everybody
         i am using NT and have downloaded the jakarta-tomcat .
my directory structure is : c:\foo\tomcat\jakarta-tomcat
i am setting the TOMCAT_HOME as below:
set TOMCAT_HOME = c:\foo\tomcat\jakarta-tomcat (at command prompt)
and also in the tomcat.bat file . 
when i give startup, it is giving an error , 
"The system cannot find the path specified "

can anybody help me out please.....
i have stuck up at this moment!!!!

lots of thanks in advance...

r-a-v-i


virtual hosts

Posted by Matjaz Trtnik <ma...@portal.si>.
how to configutr tomcat for virtual hosting?
i did everything by the manuals but i am getting 404 error when i try to use
.jsp files .html works okie.
thanks.

best regards,
matjaz



HttpServletResponse.flushBuffer() and/or PrintWriter.flush() not working in Tomcat

Posted by Thomas Weitzel <tw...@bouncy.com>.
Tomcat (environment NT4SP6, Sun JDK 1.3, Tomcat 3.1 up to 3.2B8) is not sending the
data to the client as expected. It only sends data to the client when either the
servlet-thread finishes or 4K or more are written.

Basically it's needed for our test scripts and our HTML chat application. The
following snippet illustrates the problem. Tomcat 3.1 and all Betas up to the
current Beta 8 have this problem.

Expected behaviour: the text "The servlet has received ..." should appear in the
browser. 5 seconds later, the text "This is the end ..." is added to the page.

Actual behaviour: 5 seconds after sending the request, the entire text appears at
once.

    out.println("<html>");
    out.println("<head><title>FlushServlet</title></head>");
    out.println("<body>");
    out.println("<p>The servlet has received a GET on " + new Date() + "</p>");
    out.flush();
    response.flushBuffer();
    sleep(5000);  // sleeps for 5000 millis
    out.println("<p>This is the end of the page.</p>");
    out.println("</body></html>");
    out.flush();
    response.flushBuffer();

When I test this with Java Web Server 2.0P3 and JDK 1.1.7 or 1.3, it works as
expected. Is it a bug in Tomcat (since 3.1)?



Re: Automatic updating of classpath

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Fran Fabrizio wrote:

> Isn't Tomcat supposed to automatically add the WEB-INF/classes/
> directory to it's classpath under Linux?  I thought I remember reading
> that, but so far, I've had to explicitly add it every time.  I hadn't
> thought much of it, but a co-worker just came to me with the same
> complaint.  What's the real story on this?
>

Tomcat makes the classes under WEB-INF/classes available to that web
application, but it does *not* do so by modfiying the CLASSPATH.  It makes sense
when you think about it -- the class path is global to the entire JVM which
Tomcat runs in, while the classes available to each web app are different.

Tomcat accomplishes what it does by creating a customized class loader for each
web application.  This class loader is told to look for classes under
WEB-INF/classes or in JAR files under WEB-INF/lib.

>
> Thanks,
> Fran
>

Craig McClanahan