Hello, I am using JavaMail APIs in my web-application and some of the functions offerred by the web-app involve sending emails using the JavaMail APIs. When I undeploy the Web-App, the web-app directory Tomcat5.0.28\webapps directory in not deleted completely, the only file left behind is Tomcat5.0.28\webapps\<myapp>\WEB-INF\lib\mail.jar(mail.jar is the Library for JavaMail).
Does anyone know why this might be happening? I greatly appreciate any response.
Originally posted by Nimala Rayudu: Ben, The file has read-only permission in the web-application's lib directory when it is deployed, but so do all other library files I have in the lib directory, and all of them are deleted by Tomcat.
This is a known problem with Tomcat under WinWows, but not when running under Solaris or Linux. I've been fighting with it all day and have found some documentation in the Tomcat Windows FAQ. The faq suggests using the antiJARLocking attribute in the context.xml file to prevent this. I haven't tried this yet, but conversations on the Sun forums indicate that it isn't fully fixed as of Tomcat-5.5.7.
I use WinXP as my development environment and Solaris as my run environment and have different Ant targets for producing the war files. For Windows I put most of the jars in commons/lib which may cause classloader problems if multiple apps use the jars, but I only run one app under windows. For Solaris I put the jars in WEB-INF/lib where they belong. I know its a nasty kludge, but it works.
One package that really doesn't belong in common/lib is Velocity, its jars MUST be in WEB-INF/lib since it uses the Singleton Pattern, luckily it doesn't have the locked jars problem. The Hibernate documentation warns against putting anything in common/lib.