Markus Garscha wrote: > when i put postgres.jar in the CLASSPATH of tomcat then tomcat fails > with: > > org.exolab.castor.mapping.MappingException: Could not find the class > de.gama.kadr.data.Person > > which is in the same jar as Agent. when i put the whole .jar in the > tomcat CLASSPATH then it works. why dosen't it work just putting it in > WEB-INF/lib directory?
This is a ClassLoader issue. The ClassLoader for the the startup of Tomcat owns the CLASSPATH, which includes the jar files in Tomcat's lib directory. For dynamic reloading of servlets Tomcat uses a different class loader for each web application. When Class.forName() is used it does not know about anything but the default ClassLoader; in this case that is the one at the Tomcat lib level. Therefore anything that uses Class.forName() will not work unless those classes are explicitly listed in the CLASSPATH at startup. In know, it sucks royally and I wish that Sun would have fixed this long ago with some way of registering ClassLoaders. - Drew -- Drew Davidson Chief Scientist/Director, Research & Development OGNL Research Labs (520) 531-1966 (520) 370-5117 (cell) (520) 531-1965 (fax) [EMAIL PROTECTED] http://www.paintyourselfsilly.com http://www.ognl.org ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
