pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maciek Sakrejda <msakrejda@truviso.com>
To: Major Services <services.major@gmail.com>
Cc: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Date: Wed, 10 Mar 2010 10:41:44 -0800
Message-ID: <895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com> (raw)
In-Reply-To: <375c2da1003101034o4995f5c5u9beebe90e6e0f43a@mail.gmail.com>
References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com>
	<4B96CC72.2070306@catalyst.net.nz>
	<375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com>
	<375c2da1003101034o4995f5c5u9beebe90e6e0f43a@mail.gmail.com>

Okay, this looks like the stack trace you originally posted. So now
we're back to what we were asking earlier--can you enable logging in
the driver or capture the traffic on the wire with a tool like
Wireshark or tcpdump?

---
Maciek Sakrejda | Software Engineer | Truviso

1065 E. Hillsdale Blvd., Suite 230
Foster City, CA 94404
(650) 242-3500 Main
(650) 242-3501 F
msakrejda@truviso.com
www.truviso.com



On Wed, Mar 10, 2010 at 10:34 AM, Major Services
<services.major@gmail.com> wrote:
> Please ignore the previous output.
>
> Here is the one to consider:
>
> org.apache.jasper.JasperException: An exception occurred processing JSP page
> /jsp/pgtest.jsp at line 14
>
> 11:  String url =
> "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major";
>
> 12:  Properties props = new Properties();
> 13:  props.setProperty("loglevel","2");
> 14:  Connection conn = DriverManager.getConnection(url , props);
> 15: }
> 16: %>
> 17: </body>
>
>
>
> Stacktrace:
> 	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
>
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> root cause
>
> javax.servlet.ServletException: org.postgresql.util.PSQLException: Protocol
> error.  Session setup failed.
>
> 	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
> 	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
> 	org.apache.jsp.jsp.pgtest_jsp._jspService(pgtest_jsp.java:80)
>
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
>
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> 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)
> 	org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
>
> 	org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
> 	org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
> 	org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
>
> 	org.postgresql.Driver.makeConnection(Driver.java:393)
> 	org.postgresql.Driver.connect(Driver.java:267)
> 	java.sql.DriverManager.getConnection(DriverManager.java:525)
> 	java.sql.DriverManager.getConnection(DriverManager.java:140)
>
> 	org.apache.jsp.jsp.pgtest_jsp._jspService(pgtest_jsp.java:68)
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
>
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
>
> On Wed, Mar 10, 2010 at 8:01 PM, Major Services <services.major@gmail.com>
> wrote:
>>
>> 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: }
>>
>> Thanks
>>
>> On Wed, Mar 10, 2010 at 4:02 AM, Mark Kirkwood
>> <mark.kirkwood@catalyst.net.nz> wrote:
>>>
>>> Major Services wrote:
>>>>
>>>> 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 PostgreSql 8.4
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> Try adding some debug info (will help us see what is going on) - e.g:
>>>
>>>
>>>  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);
>>>
>>>
>>>
>>> regards
>>>
>>> Mark
>>
>
>



view thread (15+ messages)  latest in thread

Message-ID: <895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com>
Permalink:  ../895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com/
Also on:    postgresql.org/message-id/895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: msakrejda@truviso.com, services.major@gmail.com, mark.kirkwood@catalyst.net.nz
  Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
  In-Reply-To: <895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com>
  References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B96CC72.2070306@catalyst.net.nz> <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> <375c2da1003101034o4995f5c5u9beebe90e6e0f43a@mail.gmail.com> <895e58dd1003101041p71e49f22o7a8d979a6e7bbb04@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox