Skip site navigation (1) Skip section navigation (2)

Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed

From: dmp <danap(at)ttc-cmc(dot)net>
To: Guillaume Cottenceau <gc(at)mnc(dot)ch>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Date: 2010-03-10 17:30:08
Message-ID: 4B97D720.4060204@ttc-cmc.net (view raw or flat)
Thread:
Lists: pgsql-jdbc
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



In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2010-03-10 18:12:00
Subject: Re: Retrieving multidimentional array-column using JDBC
Previous:From: Guillaume CottenceauDate: 2010-03-10 14:54:58
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group