Don’t think, implement : standards, accessibility, best practices
I had a very interesting experience today while testing communication between a SOAP client and server. I had Tomcat running with SOAP and was running the following command via DOS:
java za.co.package.soap.client.GetCountApp
I was continually getting the same error related to ClassNotFound errors. I adjusted and re-adjusted my CLASSPATH oover and over again, moved files around all in an attempt to fix this problem. But every time I ran the command again the same problem persisted. After about a hour I got extremely frustrated and just closed the DOS window and took a break.
Now here is the interesting bit…
I did not change a thing, fired up the DOS window and ran the same command again. Hey Presto! It works! Now what this tells me is that DOS had to have been caching the response returned from Tomcat and continually feeding me the same response. Closing the window cleared the cache and the command was sent to Tomcat again which this time responded with the correct response.
This was a big surprise to me and I thought I would share it with everyone. If I am wrong and DOS was not caching what was it doing? Please feel free to leave your comments here.
Cheers!
Schalk Neethling is a highly experienced and enthusiastic Java standards based web developer currently located in Pretoria, South-Africa. He has been working on the web for the past 6 years developing and designing web sites/applications for clients around the world.
He has extensive knowledge of XHTML, CSS, JavaScript, Ajax, JEE, JSP, PHP and more. He is actively involved in the open source, standards and accessibility community.
CyberMandrake
December 7th, 2006 at 2:38 pm
I’ve stumbled upon this also. But the explanation seems to be simpler: the environment variables set in Windows are copied to the CMD/DOS session, and doesn’t change when you ajust them again in windows. Only issuing commands in the CMD windows the variables can be ajusted.

So, when you closed the window and fired a new one, that new DOS session re-read the environment vars, and everyone became happy
speps
December 7th, 2006 at 5:11 pm
In fact, you have to close and restart a cmd to get environment variables to be changed. Or simply run ‘cmd’ from a cmd.
S C
December 7th, 2006 at 8:28 pm
If you were adjusting the CLASSPATH environment variable from in windows then this makes perfect sense. The command window (it really isn’t DOS in XP and up anymore) caches environment variables. You can choose to use the set command to change a variable or do it in windows and open a new command prompt.
schalk
December 7th, 2006 at 8:44 pm
Thanks everyone for your comments. What you are saying makes complete sense.
So the CLASSPATH is cached and if I make adjustments to the CLASSPATH I need to close the current window and open a new command window so it reads in the new CLASPATH.
Good to know.