Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E80F3634A47 for ; Wed, 18 Mar 2009 06:00:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 92780-07 for ; Wed, 18 Mar 2009 05:59:59 -0300 (ADT) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id 5671C634A42 for ; Wed, 18 Mar 2009 06:00:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from dewire.com (mail.dewire.com [83.140.172.130]) by mx3.hub.org (Postfix) with ESMTP id D580537B700 for ; Wed, 18 Mar 2009 06:00:01 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by dewire.com (Postfix) with ESMTP id 6E726138AD75; Wed, 18 Mar 2009 09:59:51 +0100 (CET) X-Virus-Scanned: by amavisd-new at dewire.com Received: from dewire.com ([127.0.0.1]) by localhost (torino.dewire.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TOF-CMPTHJPY; Wed, 18 Mar 2009 09:59:50 +0100 (CET) Received: from sleipner.localnet (unknown [10.9.0.4]) by dewire.com (Postfix) with ESMTP id B0534138AD55; Wed, 18 Mar 2009 09:59:50 +0100 (CET) From: Robin Rosenberg To: Oliver Jowett Subject: Re: NoClassDefFoundErrors Date: Wed, 18 Mar 2009 09:59:47 +0100 User-Agent: KMail/1.11.1 (Linux/2.6.27-12-generic; KDE/4.2.1; i686; ; ) Cc: pgsql-jdbc@postgresql.org References: <200903180901.41694.robin.rosenberg.lists@dewire.com> <49C0B4C4.1070708@opencloud.com> In-Reply-To: <49C0B4C4.1070708@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903180959.48234.robin.rosenberg.lists@dewire.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/93 X-Sequence-Number: 19423 onsdag 18 mars 2009 09:45:56 skrev Oliver Jowett : > Robin Rosenberg wrote: > > Under various error conditions (and possibly otherwise) we get noclassdeffound errors instead of an SQL exception. > > > > Caused by: java.lang.NoClassDefFoundError: org/postgresql/core/Parser > > at org.postgresql.core.v3.QueryExecutorImpl.parseQuery(QueryExecutorImpl.java:77) > > at org.postgresql.core.v3.QueryExecutorImpl.createParameterizedQuery(QueryExecutorImpl.java:55) > > > We're currently on version 8.3-603 of the driver within glassfish 2.1 > > $ jar tvf postgresql-8.3-603.jdbc2.jar | grep Parser.class > 2904 Thu Jan 31 03:01:38 NZDT 2008 org/postgresql/core/Parser.class > > The class is there, so either you have a mangled copy of the driver jar, > or glassfish is breaking something, or you have encountered a JVM bug. > Parser is an integral part of the driver, used whenever you have a query > that contains any of these characters: '"-/$ > > -O > Indeed it is there. NoClassDefFoundError is ofter confused with ClassNotFoundException. NoClassDefFoundError means the class was found, but it couldn't be loaded because of another class was needed for the base class or interface or an exception was thrown in a static initializer during class loading. There might be other reasons, but those are the ones I know about. The problem is that these errors are very hard to debug, so I was hoping for a clue. -- robin