Org.postgresql.util.psqlexception Protocol Error
here for a quick overview of the site Help Center protocol error session setup failed postgresql Detailed answers to any questions you might have Meta Discuss
Postgresql Jdbc Driver
the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up org.postgresql.util.PSQLException: Protocol error. Session setup failed up vote -1 down vote favorite i am trying to connect to a postgresql server 9.3 running in my local machine. org.postgresql postgresql 9.3-1100-jdbc41 Also tried above jar for Driver class. Caused by: org.postgresql.util.PSQLException: Protocol error. Session setup failed. at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:510) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:173) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64) at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:136) at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:29) resulted in above exception. any idea how to ge around this problem? postgresql jdbc share|improve this question edited Jan 1 '14 at 7:49 Craig Ringer 134k19224307 asked Jan 1 '14 at 5:08 Selvakumar Esra 442722 possible duplicate of PostgreSQL "Protocol error. Session setup failed.." error among others. –Brian Roach Jan 1 '14 at 5:12 Provide the username and password. How are you getting your Connection? –Elliott Frisch Jan 1 '14 at 5:12 1 @BrianRoach I don't think so... that was a version mismatch; this looks like a failure in authentication. –Elliott Frisch Jan 1 '14 at 5:14 Examine the
Regional lists Associations User groups Project lists pgadmin-hackers pgadmin-support pgsql-jdbc pgsql-odbc pgsql-pkg-debian pgsql-pkg-yum psycopg Inactive lists IRC Local User Groups Featured Users International Sites Propaganda Resources Weekly News Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed From: "Kevin Grittner" To: "Mark Kirkwood" , "Major Services" http://stackoverflow.com/questions/20865720/org-postgresql-util-psqlexception-protocol-error-session-setup-failed Cc: Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed Date: 2010-03-10 18:40:42 Message-ID: 4B97934A020000250002FBC9@gw.wicourts.gov (view raw or whole thread) Thread: 2010-03-09 16:51:14 from Major Services 2010-03-09 16:56:20 from dmp 2010-03-09 17:22:46 from Maciek Sakrejda https://www.postgresql.org/message-id/4B97934A020000250002FBC9@gw.wicourts.gov 2010-03-09 17:41:00 from Major Services 2010-03-11 01:45:08 from Lew 2010-03-09 22:32:18 from Mark Kirkwood 2010-03-10 14:31:11 from Major Services 2010-03-10 14:54:58 from Guillaume Cottenceau 2010-03-10 17:30:08 from dmp 2010-03-10 18:34:39 from Major Services 2010-03-10 18:40:42 from "Kevin Grittner" 2010-03-10 18:41:44 from Maciek Sakrejda 2010-03-10 20:31:28 from Mark Kirkwood 2010-03-10 20:32:36 from Mark Kirkwood 2010-03-11 01:48:11 from Lew Lists: pgsql-jdbc Major Services wrote: > "jdbc:postgresql://localhost:5432/postgres?user=postgres&password= > major" > *root cause* > > org.postgresql.util.PSQLException: Protocol error. Session setup > failed. > org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication( > ConnectionFactoryImpl.java:402) > org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl( > ConnectionFactoryImpl.java:108) What happens if you try to connect with: psql -h localhost
Regional lists Associations User groups Project https://www.postgresql.org/message-id/375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com lists pgadmin-hackers pgadmin-support pgsql-jdbc pgsql-odbc pgsql-pkg-debian pgsql-pkg-yum https://www.postgresql.org/message-id/4B9801A0.8080607@catalyst.net.nz psycopg Inactive lists IRC Local User Groups Featured Users International Sites Propaganda Resources Weekly News org.postgresql.util.PSQLException: Protocol error. Session setup failed From: Major Services To: pgsql-jdbc(at)postgresql(dot)org Subject: org.postgresql.util.PSQLException: protocol error Protocol error. Session setup failed Date: 2010-03-09 16:51:14 Message-ID: 375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com (view raw or whole thread) Thread: 2010-03-09 16:51:14 from Major Services 2010-03-09 16:56:20 from dmp 2010-03-09 17:22:46 from Maciek Sakrejda 2010-03-09 17:41:00 from org.postgresql.util.psqlexception protocol error Major Services 2010-03-11 01:45:08 from Lew 2010-03-09 22:32:18 from Mark Kirkwood 2010-03-10 14:31:11 from Major Services 2010-03-10 14:54:58 from Guillaume Cottenceau 2010-03-10 17:30:08 from dmp 2010-03-10 18:34:39 from Major Services 2010-03-10 18:40:42 from "Kevin Grittner" 2010-03-10 18:41:44 from Maciek Sakrejda 2010-03-10 20:31:28 from Mark Kirkwood 2010-03-10 20:32:36 from Mark Kirkwood 2010-03-11 01:48:11 from Lew Lists: pgsql-jdbc I am trying to connect to PostgreSQL database on my local system. The code is: 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 Post
Regional lists Associations User groups Project lists pgadmin-hackers pgadmin-support pgsql-jdbc pgsql-odbc pgsql-pkg-debian pgsql-pkg-yum psycopg Inactive lists IRC Local User Groups Featured Users International Sites Propaganda Resources Weekly News Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed From: Mark Kirkwood To: Major Services Cc: pgsql-jdbc(at)postgresql(dot)org Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed Date: 2010-03-10 20:31:28 Message-ID: 4B9801A0.8080607@catalyst.net.nz (view raw or whole thread) Thread: 2010-03-09 16:51:14 from Major Services 2010-03-09 16:56:20 from dmp 2010-03-09 17:22:46 from Maciek Sakrejda 2010-03-09 17:41:00 from Major Services 2010-03-11 01:45:08 from Lew 2010-03-09 22:32:18 from Mark Kirkwood 2010-03-10 14:31:11 from Major Services 2010-03-10 14:54:58 from Guillaume Cottenceau 2010-03-10 17:30:08 from dmp 2010-03-10 18:34:39 from Major Services 2010-03-10 18:40:42 from "Kevin Grittner" 2010-03-10 18:41:44 from Maciek Sakrejda 2010-03-10 20:31:28 from Mark Kirkwood 2010-03-10 20:32:36 from Mark Kirkwood 2010-03-11 01:48:11 from Lew Lists: pgsql-jdbc Oh dear - probably missing imports or something in your code. Maybe try running a standalone java program from the command line (see below), as thats what I used to check this: $ export CLASSPAT=path-to-your-postgresql.jar:. $ java test1 ---- test1.java --- import java.sql.*; import java.util.*; public class test1 { public static void main( String args[] ) throws Exception { Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; Properties props = new Properties(); props.setProperty("loglevel","2"); Connection conn = DriverManager.getConnection(url, props); Syste