Re: Problem updating class files

From: Jared Dykstra (dyksjare_at_hotmail.com)
Date: 12/19/03


Date: 18 Dec 2003 15:22:59 -0800


"Harold Ensle" <heensle@ix.netcom.com> wrote in message news:<Z_5Eb.8881$0s2.8112@newsread2.news.pas.earthlink.net>...
> Has anyone ever had this problem? I have been compiling servlet files,
> correcting them, recompiling them and seeing the changes on the
> next URL request. So everything was going smoothly. Suddenly
> I could no longer change the .class files. That is, they were changed
> but the URL was apparently calling a cached version which would
> not update. When Apache was restarted, it would then finally update.
> Needless to say this is very undesirable behavior and its sudden
> mysterious appearance is very puzzling. (To prove that it was a
> cached version, I deleted all copies of both the class and java
> files from the server and the URL call still worked!...until apache
> was restarted.)
>
> H.Ellis Ensle

A servlet's class files are never transmitted. Therefore, if they are
cached, it is the servlet container that is doing the caching. It
doesn't make sense not to cache the class files and keep them loaded
because in a production environment requests come in more often than
the class files are changed.

Since you mentioned apache, I'm going to assume you are using the
Apache tomcat servlet container. Tomcat has settings which dictate
whether it should check the class files each time a request comes in
or not to. In the latter case, you will have to reload the servlet
either by using the manager interface or by restarting the server.

If you are using a connector through to the Apache HTTPD server,
restarting the http server will have no effect on the state of the
servlet.

---
Jared Dykstra
http://www.bork.org/~jared


Relevant Pages

  • Re: Java Webservices - newbie question.....
    ... why would people use it on top of apache http server, ... Apache HTTPD in front of Tomcat is not needed but sometimes ... So, does that mean, java ws is a servlet itself? ...
    (comp.lang.java.programmer)
  • Re: Problem updating class files
    ... When Apache was restarted, ... > A servlet's class files are never transmitted. ... it is the servlet container that is doing the caching. ... > either by using the manager interface or by restarting the server. ...
    (comp.lang.java)
  • servlet with apache front end server...
    ... I need a help in porting a web application with a servlet to work with a front end apache server.. ... I created a servlet which listens for requests and gives back responses and was working fine from the development environment with Tiny HTTPServer on port 8008. ... Though the request comes to the server the request does not contain the posted data. ...
    (comp.lang.smalltalk)
  • Re: any size limit on file loaded by applet?
    ... You might try to have the applet contact (HttpUrlConnection) a servlet ... or better still a static file served by apache on the server to get the ...
    (comp.lang.java.programmer)
  • Re: ServletOutputStream to Browser OK in NS, but not IE??
    ... >> I am replacing a Netscape Application Server appLogic with a servlet. ... >> the current browser session), but always pops up the file download box ... > client accepts and processes the messages via his user agent. ...
    (comp.lang.java.programmer)