473,666 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem updating class files

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
Jul 17 '05 #1
2 2608
"Harold Ensle" <he*****@ix.net com.com> wrote in message news:<Z_******* **********@news read2.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
Jul 17 '05 #2

"Jared Dykstra" <dy******@hotma il.com> wrote in message
news:ba******** *************** ***@posting.goo gle.com...
"Harold Ensle" <he*****@ix.net com.com> wrote in message

news:<Z_******* **********@news read2.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.

Yes, I discovered the problem. I inadvertantly put the servlet directory
in the classpath (listed it in the properties file). This caused it not to
check
for new files, so it never updated the cache. I was surprised because I
never thought that any configuration would ignore the class file on disk.
But I guess it is sometimes desirable to do so for performance reasons.

H.Ellis Ensle
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
16165
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
2
1786
by: Lentdave67t | last post by:
Thank you in advance for any help you can provide. I am writing a C# program that checks to see if the URLs of favorites/bookmarks are still good. The problem I am having is that while the program is checking the URLs, the text in a label on the current window will not update until after all URLs are checked. I think the Form/Window is frozen while the http requests are occuring. Does anyone know of a way I can update the Form in real...
1
2102
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a Database. (Disconnected Datasets). The problem I have is a new SqlAdapter is required before updating the Database: Therefore, to allow the update I have to do the following:
7
2912
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the database into classes, which are used throughout the application. I have made class collections which, upon reading from the DB, create an instance of the class and store the DB values in there temporarily. My problem is that if user1 looks at...
1
1392
by: Martin Racette | last post by:
Hi, I tried the first part of the suggested code below (in a test program first), and all I get is an error telling me that "System.Windows.Forms.ToolStripStatusLabel" is not define and the same for "System.Windows.Form.Listbox" With that DLL I'm trying to fill a listbox with many filename from a directory, I tried the code before in the main window code, but when I try it from a DLL, I can not get the program to run
1
1179
by: KJ | last post by:
Hello All, I am using integrated VSS source control with my solution (VS2005). It consists of a web site (source-controlled) and several class libs (all source-controlled). I can add references to the class libraries from the web site no problem, causing the dlls to be added to the web site's bin directory. The big problem is that when I make code changes to any of the classes in the class libraries, then do a build, these changes are...
0
1824
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this code SHOULD do: - read new (=updated) licensetext from file $license_path then - read and modify recursively all files from $current_dir, replacing old
1
1781
by: Christoph Boget | last post by:
I'm experiencing a very odd problem and it's happening only in IE6. IE7, Safari, Opera and Firefox are all working properly. What's happening is that I'm using XHR request responses to update the pages DOM, there appears to be a conflict and/or race condition that pretty much locks the browser down for several minutes until one of the requests times out. A huge red flag stands out to me from the XHR object documentation...
2
2629
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.