Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYa5x-00031r-Hg for pgsql-general@arkaria.postgresql.org; Sun, 16 Dec 2018 17:20:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gYa5v-0008Ae-5Z for pgsql-general@arkaria.postgresql.org; Sun, 16 Dec 2018 17:20:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYa5u-0008AG-K1 for pgsql-general@lists.postgresql.org; Sun, 16 Dec 2018 17:20:46 +0000 Received: from mail-it1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYa5m-0002ya-R2 for pgsql-general@postgresql.org; Sun, 16 Dec 2018 17:20:44 +0000 Received: by mail-it1-x12d.google.com with SMTP id h193so16627328ita.5 for ; Sun, 16 Dec 2018 09:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GKC14pY3jFfnw7ZfgK4TvTbyYAaPPfs93x/KGsMMz88=; b=Ro3uJ8cidP1wqqS91isVn0F79zVxhnhB6wkR/5i3q34MTSWFmaAwR7aJg9due3n6yi odDSsuy7xKSu3uLJ8x73XNjP3Iz2vfuV/FGBwRD4ij8mQyxog6d+RQA50B46tZEmX/x4 Npd4TTb1ts7DhPXu8xd3ltrVLPVLEcHxOp0PYK7gk9vfGqMI1gJZDWeMtEIB4MvH5hjv DVsLnDv4ob+eJvromhJR1HFpaCBzBiOokbArzHgzfq3rZaomHwoM9lNFIswN4+jLhg3t BdOVygU4ugea2qXga0sC6t4hYm0HNCNQt7MpCb+reYbMXJ6+h+qRGkRZw1VYUtNjZylW 6FCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GKC14pY3jFfnw7ZfgK4TvTbyYAaPPfs93x/KGsMMz88=; b=G79De3SPFxdNW8tGWWxm9Lw5V6m76gLLuXsFkeKduXojIrqurHwMoiFbo7tgCcm7oN 3l2/TPRhNPKVXdVfBiWXbfmPh3ClOdiy2O2rx1PA+/RT4f+8uuye0gJvDa9S0NJgAw+e 9gp3X0PK/1ZP6oc7e6stxDc74CSH6phLY802MmxDnCj4jjG0Na0WLGEbW9/RKWPZBua6 Qh7Ht65sCA30Xc3E1a5eFJKc60AY9EMvT0n4RAJ0Fv4R+rhB4pGN9UthwnSJoRqGW71l jqZs6Jm/NV/iyHVBS0bA/nxeGqN6G71etxT683e/Jv94DW066f4psC33upxrMM9vSQ3D PrMA== X-Gm-Message-State: AA+aEWZzamRGQYRI/7I+h4TA+jdh2t4jO+LBC6R1emW9lNWtyZG1WLAb 0KfdriOMOQ1hUddRPfRFuz8= X-Google-Smtp-Source: AFSGD/WeSdTLyvLyzmzTDldj9vnKCn/Tlvwn5wMnCkVu26AzxsNgMzDWwXFEaQBamBTdjjzik3ZzMA== X-Received: by 2002:a24:a701:: with SMTP id a1mr9356711itf.7.1544980837701; Sun, 16 Dec 2018 09:20:37 -0800 (PST) Received: from [192.168.1.102] (c-73-63-59-118.hsd1.ut.comcast.net. [73.63.59.118]) by smtp.gmail.com with ESMTPSA id v4sm8782252itv.20.2018.12.16.09.20.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Dec 2018 09:20:36 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-FD2C0A5B-3470-462E-878B-E07F394BBC7F Mime-Version: 1.0 (1.0) Subject: Re: loading jdbc Driver in servlet From: Rob Sargent X-Mailer: iPhone Mail (16B92) In-Reply-To: Date: Sun, 16 Dec 2018 10:20:35 -0700 Cc: "pgsql-general@postgresql.org" Content-Transfer-Encoding: 7bit Message-Id: <3B618955-9F54-41AC-967A-A7A77A7C8085@gmail.com> References: <5182a498-cfde-e7a3-998d-fea79bedaf35@gmail.com> <516D35C9-36C4-4F25-A18A-ADDF55D0BD0A@gmail.com> <4A34E53B-49DC-4E7D-9802-645EDAF8443E@gmail.com> To: Dave Cramer List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-FD2C0A5B-3470-462E-878B-E07F394BBC7F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tomcat version 9. Embedded in my main() > On Dec 16, 2018, at 9:30 AM, Dave Cramer wrote: >=20 > My guess is it has something to do with your servlet classpath loader. Whi= ch servlet engine are you using ? > Dave Cramer >=20 > davec@postgresintl.com > www.postgresintl.com >=20 >=20 >> On Fri, 14 Dec 2018 at 16:04, Rob Sargent wrote: >>=20 >>=20 >>>> On Dec 14, 2018, at 2:02 PM, Rob Sargent wrote:= >>>>=20 >>>>=20 >>>>=20 >>>> On Dec 14, 2018, at 1:30 PM, Dave Cramer wrote: >>>>=20 >>>> Strange, I wouldn't think so, but then I haven't used a raw servlet for= so long I have no idea. >>>>=20 >>>>=20 >>>> Dave Cramer >>>>=20 >>>> davec@postgresintl.com >>>> www.postgresintl.com >>>>=20 >>>>=20 >>>>> On Fri, 14 Dec 2018 at 13:29, Rob Sargent wrot= e: >>>>> Using java 1.8, postgresql-42.1.4.jar, embedded tomcat 9 >>>>>=20 >>>>> It appears to me that I need to make the call "Class.forName("org.post= gresql.Driver)" when the entry is in a servlet. Is this expected, within a s= ervlet, or is this just post hoc ergo propter hoc at it finest and I changed= something else (wittingly or not). Same code outside of servlet does not n= eed the forced loading of the class and the manual claims it's not need afte= r java 1.6 >>>>>=20 >>> I too am suspicious. But the vagaries of javax are daunting. >>> But if I comment it out, as just now, =E2=80=9CNo suitable driver found.= ..=E2=80=9D. I was days playing with configuration and such think that this= very specific error message was telling me my CLASSPATH was wrong. >>>=20 >>> I wonder if I have an old javax installation (which I put in place just r= ecently). >>>=20 >>>=20 >> I=E2=80=99m using javax.servlet-api-3.1.0.jar >>>=20 >>>=20 >>=20 --Apple-Mail-FD2C0A5B-3470-462E-878B-E07F394BBC7F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Tom= cat version 9. Embedded in my main()

On Dec 16, 20= 18, at 9:30 AM, Dave Cramer <pg@fastc= rypt.com> wrote:

My guess is it has something to do with your servlet cl= asspath loader. Which servlet engine are you using ?
<= div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"= >


O= n Fri, 14 Dec 2018 at 16:04, Rob Sargent <robjsargent@gmail.com> wrote:

<= div>
On Dec 14, 2018, at 2:02 PM, Rob Sarg= ent <robjsarge= nt@gmail.com> wrote:


<= div>
On Dec 14, 2018, at 1:30 PM, Dave Cra= mer <pg@fastcrypt.c= om> wrote:

Strange, I wouldn't think so, but then I= haven't used a raw servlet for so long I have no idea.

<= br clear=3D"all">


On Fri, 14 Dec 2018 at 13:29, Rob Sargent <robjsargent@gmail.com&g= t; wrote:
=20 =20 =20

Using java 1.8, postgresql-42.1.4.jar, emb= edded tomcat 9

It appears to me that I need to make the call "Class.forName("org.postgresql.Driver)" when the entry is in a servlet.  Is this expected, within a servlet, or is this just <= i>post hoc ergo propter hoc at it finest and I changed something else (wittingly or not).  Same code outside of servlet does not= need the forced loading of the class and the manual claims it's not need after java 1.6

I too am suspicious.  But the vagaries of java= x are daunting.
But if I comment it out, as just now, =E2=80=9CNo suitab= le driver found...=E2=80=9D.  I was days playing with configuration and= such think that this very specific error message was telling me my CLASSPAT= H was wrong.

I wonder if I have an old javax instal= lation (which I put in place just recently).


I=E2=80=99m using javax.servlet-api-3.1.0.jar



= --Apple-Mail-FD2C0A5B-3470-462E-878B-E07F394BBC7F--