Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 54780 invoked by uid 99); 4 Jan 2005 04:46:28 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.plumcreek.com (HELO cfo-msg.plumcreek.net) (208.4.182.150) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 03 Jan 2005 20:46:25 -0800 Received: from plumcreek-MTA by cfo-msg.plumcreek.net with Novell_GroupWise; Mon, 03 Jan 2005 21:46:22 -0700 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Mon, 03 Jan 2005 21:46:06 -0700 From: "Larry Meadors" To: Subject: Re: java.lang.NoClassDefFoundError when using ibatis Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked >>> dody@heavyarms.net 01/03/05 7:41 PM >>> > ... > I have ibatis jar files in lib and also in shared lib in tomcat :( OK, this is a bad thing. Never, ever put jar files for tomcat in more that one location. The problem that arises when you do that is that you will get class cast exceptions comparing classes that are identical, but loaded by different classloaders. That is a real bugger to track down, I can tell you that from experience. :-) IMO, you should almost always put your jars in the WEB-INF/lib directory. That way, each application can be modified independently, so if you have an application that *has* to work, you can test different jars in other applications without the risk of breaking the critical one. The only exception to that rule may be if you have a JNDI-based data source that has to have the driver in common/lib, but back to the problem... :-) I have seen cases where a NoClassDefFoundError will be thrown when the real culprit was an exception in a static initializer - if the static init fails, the class is not loaded. The first error you will get is the init exception, but the second it the NCDF error. Is that a possibility here? > Perhaps i'm missing something, please let me know. Perhaps? ;-) Try recompiling with debugging info, that will provide more information, and try to figure out where tomcat is putting the logs. You may also want to try running in a debugger with a breakpoint on NoClassDefFoundError to see where it is coming from. Larry