Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0985563333A for ; Wed, 10 Mar 2010 13:46:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 28827-04 for ; Wed, 10 Mar 2010 17:46:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 4706A632A9B for ; Wed, 10 Mar 2010 13:46:26 -0400 (AST) Received: from [192.168.157.32] (unknown [216.129.226.123]) by outbound.vnet-inc.com (Postfix) with ESMTP id 08AC55A8F; Wed, 10 Mar 2010 10:46:24 -0700 (MST) Message-ID: <4B97D720.4060204@ttc-cmc.net> Date: Wed, 10 Mar 2010 10:30:08 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Guillaume Cottenceau , pgsql-jdbc@postgresql.org Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B96CC72.2070306@catalyst.net.nz> <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> <87fx48rzul.fsf@meuh.mnc.lan> In-Reply-To: <87fx48rzul.fsf@meuh.mnc.lan> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.064 tagged_above=-10 required=5 tests=AWL=0.535, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/33 X-Sequence-Number: 20373 This output error is total unrelated to your original error and does not involve the jdbc. Perhaps you should back out and try from simple to more complicated. 1. Connect on the local system with psql 2. Create a simple application, not using a servlet, and try connecting. You can use the sample main as I posted to do this or your own code. 3. Make sure a simple servlet, not using the database is working. > Hi, > Following is the error report: > > org.apache.jasper.JasperException: Unable to compile class for JSP: > > An error occurred at line: 13 in the jsp file: /jsp/pgtest.jsp > Properties cannot be resolved to a type > 10: { > 11: Class.forName("org.postgresql.Driver"); > 12: String url = > "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; > 13: Properties props = new Properties(); > 14: props.setProperty("loglevel","2"); > 15: Connection conn = DriverManager.getConnection(url, props); > 16: } I'm in agreement with Maciek comments here. I can not duplicate your PSQLException with problem with Class.forName or any other invalid input for connection. danap > I don't imagine Class.forName() would throw a PSQLException. > > If I'm reading the ConnectionFactoryImpl code correctly, the server > seems to be responding to the Startup message with something that is > neither an error nor an authentication request, which seems weird. Can > you use Wireshark or tcpdump to look at traffic on the wire? > --- > Maciek Sakrejda | Software Engineer | Truviso > Class.forName("org.postgresql.Driver"); > String url = > "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; > Connection conn = DriverManager.getConnection(url); > > Running the code I get: > > org.postgresql.util.PSQLException: Protocol error. Session setup failed. > > Using postgresql-8.4-701.jdbc3 on PostgreSql 8.4