• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Tomcat showing wrong date/time

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Funny thing happened today.

Our testing services was carrying out test on apps deployed on Tomcat 5.5, which OS and JVM have been patched for the new DST times for New Zealand. Our new DST starts at 2am Oct 1st.

After patching both the JVM and OS they moved the date on the server (Solaris 9) forward to Oct 1st, and opened a page from the application that was deployed on Tomcat.

The page (jsp) shows a date and time on a using


Funnily enough the above code showed the date and time that matched the client machine's date/time, and not the server's.

Thus it showed 21 August 2007 and not 1 October 2007.

This was rectified by restarting Tomcat. However I'm curious to find out why/how Tomcat was holding to the previous date/time.

Any idea? Thanks for your opinions.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because the Java classes for the Date used by the session where loaded before the change. Java classes are not hot redeployable, just some application/web servers do redeploys and only in some especific dirs.
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!