Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
refreshing what tomcat has in memory

refreshing what tomcat has in memory

2004-01-05       - By Stephen Charles Huey

 Back
I have a copy of Tomcat both on my dev machine and my production machine.
I have some code that looks for an image in a given location, and on the
dev machine (which I set up), the code was working fine (the code takes
that image and inserts it in the middle of a larger one that I'm
drawing).  I was wondering why the image wasn't appearing in the picture
I was generating on the production machine (which I didn't set up--that
contractor was around before I got on board and is no longer with us),
and then realized I simply hadn't copied the image over to the
appropriate directory on that computer.  However, when I did copy the
image into the right directory, it still wasn't picking it up, so I
restarted Tomcat using the Win 2000 Server Services explorer.  However,
the small 1 KB image still wasn't being picked up and placed into the
image I was drawing even though the code was the same as on the dev
machine.  I was baffled, and I stopped and started Tomcat a few times and
then it finally started getting picked up!  So then I deleted the image
from the directory, restarted Tomcat, and the image was still being found
even though it wasn't there!  I restarted Tomcat again, and finally it
wasn't being found anymore.  In my code, I'm explicitly specifying that
the image should be searched for in a pretty-hardcoded sort of manner
every single time it's needed, but I'm thinking Tomcat might cache
certain low-level operations in memory (or does Windows do it, perhaps?).
I'm wondering if Tomcat might have remembered that that image hadn't
been found before, so was returning some sort of empty file (though I
don't think there were any exceptions, b/c I've searched for the expected
println statements in my Tomcat stdout and stderr log files) every time
after that...and if it was just in memory, then maybe stopping Tomcat
from the Windows Services explorer doesn't get rid of Tomcat's stack
memory (maybe Windows maintains that memory until you restart Tomcat,
even it seems like that wouldn't be the behavior you'd expect).  

I've included the code down at the bottom--it's pretty straightforward.
I'd really like to know, because there have been times when I have tried
to deploy updated JAR files and Tomcat just wouldn't pick them up.  When
a modified JSP isn't being re-compiled, I know to go search for the
genereated Java code and class files in the work directory and delete
them to force re-compilation, but I don't know what to do it to find a
newly modified JAR file!  Or in my other case, a newly "modified" image!  

Thanks for any clarifications!

Here's the code I was referring to:

     String logoLocation = GlobalSettings.getSetting("imagedir") +
     "AE89x35.png";
     try {
       //Image logo =
       Toolkit.getDefaultToolkit().getImage(logoLocation);
       javax.swing.ImageIcon Source code of javax.swing.ImageIcon logoIcon = new
       javax.swing.ImageIcon Source code of javax.swing.ImageIcon(logoLocation);
       Image logo = logoIcon.getImage();
       //System.out.println("logoLocation is " + logoLocation);
       if (logo == null) System.err.println("logo is null, and toString
       gives "  + logo.toString());
       // Draw image
       boolean drawn = oCanvas.drawImage(logo, 185, 190, null);
       //System.out.println("drawn is " + drawn);
     } catch (Exception e) {
       System.err.println("Unable to find Airborne logo at " +
       logoLocation + ": " + e);
     }

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.