Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3CEF56346ED for ; Wed, 10 Mar 2010 14:34:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77730-09 for ; Wed, 10 Mar 2010 18:34:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id B3FCA632A9B for ; Wed, 10 Mar 2010 14:34:41 -0400 (AST) Received: by wyb38 with SMTP id 38so256469wyb.19 for ; Wed, 10 Mar 2010 10:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=RZFi1wWA6sFJWe/LlQ1cdwg32hI9iv8IdjXctC+mZW8=; b=WR+XMutUSL69C45AaTT1jG8UmqeUs9+b8/pH0Ntk/W9yrHuT/sEe42OVIbBjMBkNhM NMDng4TDcqRnZKKIz86OynC/aROOLhpsUksnwd3Z5CANS+A0606jzEukBjTfIy0VhZ3C +Nd2o4LSWc3tA0G1CfoVaU6J1ztsbXFYRz0aQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XIGWC0fXVszyxt/c++TaZA+caLG5+/Oq1VWCoNC5Y0Rb1aAEq5kwX2dVMZvr33u7wu hiBVkmivtXcbpEVa9luC6R+9zgOGWTK/n52bkPAL7aZehS+olF0/fvj4/cFyfIrGIaPw 5kwNkn/2lhkIh8O5r8DmFIAz1Db6FlGB8gLGg= MIME-Version: 1.0 Received: by 10.216.85.9 with SMTP id t9mr793430wee.79.1268246080465; Wed, 10 Mar 2010 10:34:40 -0800 (PST) In-Reply-To: <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B96CC72.2070306@catalyst.net.nz> <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> Date: Thu, 11 Mar 2010 00:04:39 +0530 Message-ID: <375c2da1003101034o4995f5c5u9beebe90e6e0f43a@mail.gmail.com> Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed From: Major Services To: Mark Kirkwood Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d778af1d338e0481768dba X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/36 X-Sequence-Number: 20376 --0016e6d778af1d338e0481768dba Content-Type: text/plain; charset=ISO-8859-1 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: 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.(AbstractJdbc2Connection.java:125) org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:30) org.postgresql.jdbc3.Jdbc3Connection.(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 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 >> > > --0016e6d778af1d338e0481768dba Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Please ignore the previous output.

Here is the one to consider:
<= br>
org.apache.jasper.JasperException: An exception occurred processing=
 JSP page /jsp/pgtest.jsp at line 14

11: String url =3D "jdbc:= postgresql://localhost:5432/postgres?user=3Dpostgres&password=3Dmajor&q= uot;;
12: Properties props =3D new Properties();
13: props.setProperty("= ;loglevel","2");
14: Connection conn =3D DriverManager.g= etConnection(url , props);
15: }
16: %>
17: </body>

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspEx= ception(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServle= tWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.= JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
java= x.servlet.http.HttpServlet.service(HttpServlet.java:717)

roo= t cause

javax.servlet.ServletException: org.postgresql.util.PS=
QLException: Protocol error.  Session setup failed.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContex= tImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageExc= eption(PageContextImpl.java:791)
org.apache.jsp.jsp.pgtest_jsp._jspServ= ice(pgtest_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
jav= ax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.ja= sper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.= apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
java= x.servlet.http.HttpServlet.service(HttpServlet.java:717)

roo= t cause

org.postgresql.util.PSQLException: Protocol error.  Se=
ssion setup failed.
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFa= ctoryImpl.java:402)
org.postgresql.core.v3.ConnectionFactoryImpl.openCo= nnectionImpl(ConnectionFactoryImpl.java:108)
org.postgresql.core.Connec= tionFactory.openConnection(ConnectionFactory.java:66)
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Con= nection.java:125)
org.postgresql.jdbc3.AbstractJdbc3Connection.<init= >(AbstractJdbc3Connection.java:30)
org.postgresql.jdbc3.Jdbc3Connect= ion.<init>(Jdbc3Connection.java:24)
org.postgresql.Driver.makeConnection(Driver.java:393)
org.postgresql.D= river.connect(Driver.java:267)
java.sql.DriverManager.getConnection(Dri= verManager.java:525)
java.sql.DriverManager.getConnection(DriverManager= .java:140)
org.apache.jsp.jsp.pgtest_jsp._jspService(pgtest_jsp.java:68)
org.apac= he.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servle= t.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.serv= let.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
ja= vax.servlet.http.HttpServlet.service(HttpServlet.java:717)
=A0

On Wed, Mar 10, 2010 at 8:01 PM, Major Servi= ces <servi= ces.major@gmail.com> wrote:
Hi,
Following is the error report:

org.apache.jasper.JasperE= xception: Unable to compile class for JSP:

An error occurred at lin= e: 13 in the jsp file: /jsp/pgtest.jsp
Properties cannot be resolved to = a type
10: {
11: Class.forName("org.postgresql.Driver");
12: Stri= ng url =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpostgres&= amp;password=3Dmajor";
13: Properties props =3D new Properties();<= br> 14: props.setProperty("loglevel","2");
15: Connection conn =3D DriverManager.getConnection(url, props);
16: }<= br>
Thanks


On Wed, Mar 10, 2010 at 4:02 AM, Mark Kirkwood &= lt;mark.= kirkwood@catalyst.net.nz> wrote:
<= div>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 =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpostg= res&password=3Dmajor";
Connection conn =3D 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:
<= br>

=A0Class.forName("org.postgresql.Driver");
=A0String url =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpo= stgres&password=3Dmajor";

=A0Properties props =3D new Properties();
=A0props.setProperty("loglevel","2");

=A0Connection conn =3D DriverManager.getConnection(url, props);



regards

Mark


--0016e6d778af1d338e0481768dba--