Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D363E200B65 for ; Wed, 17 Aug 2016 20:17:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D1DE1160A8C; Wed, 17 Aug 2016 18:17:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE147160A6C for ; Wed, 17 Aug 2016 20:17:37 +0200 (CEST) Received: (qmail 29035 invoked by uid 500); 17 Aug 2016 18:17:36 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 29024 invoked by uid 99); 17 Aug 2016 18:17:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2016 18:17:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8A24D1A1318 for ; Wed, 17 Aug 2016 18:17:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id F6ggg9Of-lHY for ; Wed, 17 Aug 2016 18:17:33 +0000 (UTC) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 3DFB45F23D for ; Wed, 17 Aug 2016 18:17:32 +0000 (UTC) Received: by mail-it0-f43.google.com with SMTP id x131so6879588ite.0 for ; Wed, 17 Aug 2016 11:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=SQabB8jfW6AYa/PLCyU37EZYbuEcONJq9kKiUM62d/4=; b=kb5YpZp+zzWRyge3wrkBnF+jWgyIm4V5EwANA5HfV5rFdHlB55/47AsS/huk+8LITK LZjerAfBgN3cqJsoUWO0mN5GKevGQVdMxu8OlqlTeJOLHXqzYRudflp4PyD9t8SPF6ER 1l8woWjjQ0OcZqDkwJVBCr7sd3IChYCo8aq41PTX5KFRoHCD8IJNxFAXysSM5ueaXVVi eBHjS0458lrPDtVbJ8qegKupYmmh+ekWOlO8kehm8pVRVfoBJJpk+UhVBb4UOBJCqKHt CJAG4f8+qTJn0tp4EbWl682M1dNqVt1KHnk9ATRtG+4zlQHh+q/HNcsSb1apBbZVEBBn Iqtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=SQabB8jfW6AYa/PLCyU37EZYbuEcONJq9kKiUM62d/4=; b=V8ZbuJ4mtEohGH/DLOoKDKWJgar8rcLCqpMCYsSdrhvkTFkoVjvq4Vgg8vgwv3dpwK TZQ5OQx7EgCVqPSwdqjpa/bZnA37BKjcYRlIvxdudNsia3HG0/UVbEiW+ZhFtAXR4inj /as9qKNh7yqWRptpI977aZ5UtBQQ7OldQXGJ9Rxu/hjXDqUAhC9oEa37VKPKncgMN4pt Ff0kDi+b5fHUN8o21XBLeuOpJ+aqXM4tvbr6a6L9LRvi7vg80Xg5CU9PboQ5KOLbVe4p 0plvP6PFKRXHFD/DKnSZnVZ7ifp6J2yh1muxZy2jeYbZU9MiKFNoQyj2fIL35wjYiya4 BHzg== X-Gm-Message-State: AEkoouuFzSQICx2kB4xH5F3wS44nDeVFa0DCh5FoSlEnl6TgBT3h1AIqmG2PHCZxI3m9XjXyufOHxDcc3G0HZw== X-Received: by 10.36.253.131 with SMTP id m125mr27728538ith.24.1471457850878; Wed, 17 Aug 2016 11:17:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.138.134 with HTTP; Wed, 17 Aug 2016 11:17:30 -0700 (PDT) In-Reply-To: References: <604f86c5-ad77-2c47-da7a-739e155295fa@mhsoftware.com> <57B428F3.2020405@ice-sa.com> <57B43193.5080808@ice-sa.com> <57B47132.6090504@ice-sa.com> From: Andrew Davis Date: Wed, 17 Aug 2016 13:17:30 -0500 Message-ID: Subject: Re: Set up postgresql on tomcat7 To: Tomcat Users List Content-Type: multipart/alternative; boundary=94eb2c035eb680ef12053a487a33 archived-at: Wed, 17 Aug 2016 18:17:39 -0000 --94eb2c035eb680ef12053a487a33 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sorry, I got confused from yesterday and continued the question on my second machine without realizing . I have two machines. The one I started the question with is: Machine number 1. Ubuntu 14.04, Tomcat7 as my web server, I have postgreSQl 9.3 installed as my dbServer. java version 1.8.9_91 Machine number 2 RHEL 6, Tomcat6 as web server, postgreSQL 9.3 dbServer. java version 1.7.0_101 I am focusing my effort on the first machine. (Ubuntu).. Andy. On Wed, Aug 17, 2016 at 12:47 PM, Mark Eggers wrote: > Replies at the end: > > Andrew: > > On 8/17/2016 7:15 AM, Andrew Davis wrote: > > Its a redhat .. i don't think tomcat 7 or later will run on this. > > > > On Aug 17, 2016 9:14 AM, "Andr=C3=A9 Warnier (tomcat)" > > wrote: > > > >> On 17.08.2016 16:06, Andrew Davis wrote: > >> > >>> Thanks for the prompt.. > >>> > >>> I have been looking at the doc s and have my .jar file for > >>> postgres in the lib folder. > >>> > >>> I do not understand where the >>> name=3D"jdbc/postgres..." > >>> > >>> Is supposed to go. > >>> > >>> Im reading at > >>> https://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource- > >>> examples-howto.html > >>> > >> > >> If your version is Tomcat 7, then maybe you should look at the > >> Tomcat 7 documentation, not the v 6 one. > >> > >> In any case, even Tomcat 7 is somewhat old now. Can you upgrade to > >> a later version ? That might increase your chances of getting help > >> here. > >> > >> > >>> This author has not had success here... > >>> > >>> This doesn't inspire confidence here, but that's what the > >>> documentation shows... > >>> > >>> > >> Sorry, but personally my expertise in these matters is nil, so I > >> hope someone else here can pick this up now. > >> > >> Andy > >>> > >>> On Aug 17, 2016 4:43 AM, "Andr=C3=A9 Warnier (tomcat)" > >>> wrote: > >>> > >>> On 17.08.2016 11:32, Andrew Davis wrote: > >>> > >>> Thanks. > >>>> > >>>> I can now deploy my servlets and they work ok, but.. > >>>> > >>>> I had hoped to just deploy one copy of the postgres jar to my > >>>> server and then be able to consume it inside multiple > >>>> applications, instead of having multiple copies of the jar in > >>>> multiple apps. > >>>> > >>>> I've been through the JNDI portion of the docs on Tomcat and > >>>> found it still somewhat confusing. > >>>> > >>>> Andy... > >>>> > >>>> > >>> I am far from an expert on this kind of thing, but have you > >>> looked at this : > >>> > >>> http://tomcat.apache.org/tomcat-8.0-doc/config/globalresources.html > >>> > >>> > >>> > Maybe that is the missing link in your understanding ? > >>> > >>> > >>> > >>> > >>> On Aug 17, 2016 4:06 AM, "Andr=C3=A9 Warnier (tomcat)" > >>> wrote: > >>>> > >>>> Andrew, > >>>> > >>>>> this list strips most kinds of attachments, so nobody saw > >>>>> your screenshots or whatever was in them. You need to > >>>>> copy/paste that text right into your message to the list > >>>>> (amd make sure that you send your message as "plain text", > >>>>> not HTML, otherwise it will be unreadable. > >>>>> > >>>>> On 17.08.2016 02:10, Andrew Davis wrote: > >>>>> > >>>>> Well, > >>>>> > >>>>>> This has not turned out how I wanted it to . > >>>>>> > >>>>>> I have 'a solution' but it isnt what I wanted to do. I > >>>>>> went back and re added the .jar file to the 'WEB-INF' > >>>>>> folder and then deployed a new WAR file. > >>>>>> > >>>>>> Now things work just 'fine' BUT I suspect that this is not > >>>>>> what a real coder would do and suspect I am still in the > >>>>>> realms of hackery.. > >>>>>> > >>>>>> [image: Inline image 1] > >>>>>> > >>>>>> Andy. > >>>>>> > >>>>>> > >>>>>> > >>>>>> On Tue, Aug 16, 2016 at 6:53 PM, Andrew Davis > >>>>>> wrote: > >>>>>> > >>>>>> I found the following in my logs.. > >>>>>> > >>>>>> > >>>>>>> from command line in Putty... > >>>>>>> > >>>>>>> cd /var/lib/tomcat7 tail -f logs/catalina.out > >>>>>>> > >>>>>>> [image: Inline image 1] > >>>>>>> > >>>>>>> I do have the jar file located in the following location > >>>>>>> on the machine.. > >>>>>>> > >>>>>>> /usr/share/tomcat7/lib > >>>>>>> > >>>>>>> https://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howt > >>>>>>> > >>>>>>> > o.html#JDBC_Data_Sources is confusing to me. It shouldnt but it is.. > >>>>>>> at this point.. > >>>>>>> > >>>>>>> Andy.. > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> On Tue, Aug 16, 2016 at 3:01 PM, George Sexton < > >>>>>>> georges@mhsoftware.com> wrote: > >>>>>>> > >>>>>>> The best place to start would be to look at tomcat's logs > >>>>>>> for exceptions > >>>>>>> > >>>>>>> or errors. > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> On 8/16/2016 12:44 PM, Andrew Davis wrote: > >>>>>>>> > >>>>>>>> Hello, > >>>>>>>> > >>>>>>>> Im working on getting java servlets to run on my > >>>>>>>> instance of Ububtu > >>>>>>>>> with tomcat7. > >>>>>>>>> > >>>>>>>>> I write my applications in Eclipse.. when i run my > >>>>>>>>> apps localhost i see everything just fine. > >>>>>>>>> > >>>>>>>>> When i export my WAR files i check the includ source > >>>>>>>>> files. > >>>>>>>>> > >>>>>>>>> I deploy the WAR file through tomcat manager. > >>>>>>>>> > >>>>>>>>> I can see the java classes which i use to insert > >>>>>>>>> records into my postgresql database. However, there > >>>>>>>>> is nothing happening. When i attempt to run them, > >>>>>>>>> no joy. > >>>>>>>>> > >>>>>>>>> I have the postgresql .jar file installed on my > >>>>>>>>> headless ubuntu server , but no luck. > >>>>>>>>> > >>>>>>>>> Aside from the .jar file is there anything else i > >>>>>>>>> need to configure? > >>>>>>>>> > >>>>>>>>> Any advice is welcome > >>>>>>>>> > >>>>>>>>> Andy > > AD: Its a redhat .. i don't think tomcat 7 or later will run on this. > > From your first message, I thought that this was Ubuntu? Please note > that different Linux distributions package Tomcat differently. > > AD: I have the postgresql.jar file installed on my headless ubuntu > server, but no luck. > > According to what I just searched for, I believe you can install Tomcat > 7 via apt-get (depending on your Ubuntu version). Tomcat 8 also appears > to be available via apt-get - again depending on your Ubuntu version. > > If you're running a RedHat 6 variant, it appears that Tomcat 6 is what's > available. > > If you're running a RedHat 7 variant, it appears that Tomcat 7 is what's > available. > > Please note that I install Tomcat manually for all of my systems, the > above is just a result of searches. YMMV. > > AD: I have been looking at the docs and have my .jar file for postgres > in the lib folder. > > Are you sure that you're placing it in the correct directory? > > From memory, RedHat - derived distributions set things up so that you > can run multiple Tomcats (see RUNNING.txt in the standard distribution). > Sometimes this means placing the JDBC jars in not-quite-so-obvious places= . > > That being said, if you place the JDBC jars in the base Tomcat library > directory, all running Tomcats (if you're running more than one) should > pick it up. > > In your log, you should have two lines near the top: > > INFO: CATALINA_BASE: (some directory path) > INFO: CATALINA_HOME: (some directory path) > > If you could, please grab those lines and paste the text (not an image) > into your reply. > > The libs directory is (should be) a subdirectory of at least > CATALINA_HOME. If you're running multiple Tomcats, their could be a libs > directory as a subdirectory of CATALINA_BASE. > > The next thing to be concerned with is permissions. Tomcat runs as a > non-privileged user (usually tomcat). Make sure that the JDBC jar file > can be read by the user running Tomcat. Typically, this is done by > changing the group and user ownership to the ones used by the Tomcat > process, and NOT by making the JDBC jar world-accessible. > > Please do an ls -l in the directory where all of the JARS are, and paste > the results in as text in your reply. > > Once all of that is sorted, we can poke around some more. > > . . . just my two cents > /mde/ > > --94eb2c035eb680ef12053a487a33--