Обсуждение: Connection failed
Hi I am using PostgreSQL 7.0.x Java2 driver on Linux Cobalt with JSP web pages. When I connect to localhost I have no problembut when I try to connect to Postgresql DB on another machine it throws an exception, that is java.security.AccessControlExceptionwhich reports "access denied". Does it depend on the driver or what else? Thanks for your help. Agostino De Bellis
i think you might need to check your pg_hba.conf file (in your data directory) and make sure there is an entry for the machine you are connecting from . also make sure postgres is started with the '-i' flag to accept tcp/ip connections ... Steve > -----Original Message----- > From: webmaster [mailto:webmaster@nmb-it.net] > Sent: 28 June 2002 16:35 > To: pgsql-jdbc@postgresql.org > Subject: [JDBC] Connection failed > > > Hi > > I am using PostgreSQL 7.0.x Java2 driver on Linux Cobalt with > JSP web pages. When I connect to localhost I have no problem > but when I try to connect to Postgresql DB on another machine > it throws an exception, that is > java.security.AccessControlException which reports "access > denied". Does it depend on the driver or what else? > Thanks for your help. > > Agostino De Bellis > > > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to > majordomo@postgresql.org > >
Already done! I have also PHP files on my sites which connect to Postgres database on the remote machine without problems. It does notdepend on pg_hba.conf file or postmaster -i process, it was the first thing I did, there must be something else, I wishto understand if it depends on the driver or not, I have also updated Postgres JDBC driver to 7.2.x Java2 but it doesnot work yet. Is it possible anything about network configuration or architecture? Thanks. On Martedì, 2 luglio 2002 14:35, Laszlo Hornyak <hornyakl@rootshell.be> wrote: > >Edit your pg_hba.conf :) > > >On Mon, Jul 01, 2002 at 07:13:14PM +0200, webmaster wrote: >> Hi >> >> I am using PostgreSQL 7.0.x Java2 driver on Linux Cobalt with >JSP web pages. When I connect to localhost I have no problem >but when I try to connect to Postgresql DB on another machine >it throws an exception, that is >java.security.AccessControlException which reports "access >denied". Does it depend on the driver or what else? >> Thanks for your help. >> >> Ago De Bellis >> >> >> >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 2: you can get off all lists at once with the unregister command >> (send "unregister YourEmailAddressHere" to >majordomo@postgresql.org) >> > >
I solved! The solution is to modify the tomcat.policy file in the conf directory. It needs to add this line: // Replace XXX.XXX.XXX.XXX with the IP address of the remote web server permission java.net.SocketPermission "XXX.XXX.XXX.XXX:1024-","connect,accept,listen,resolve"; Thanks the same! On Martedì, 2 luglio 2002 14:44, Steve Brett <SBrett@e-mis.com> wrote: >i think you might need to check your pg_hba.conf file (in your data >directory) and make sure there is an entry for the machine you are >connecting from . also make sure postgres is started with the '-i' flag to >accept tcp/ip connections ... > >Steve > >> -----Original Message----- >> From: webmaster [mailto:webmaster@nmb-it.net] >> Sent: 28 June 2002 16:35 >> To: pgsql-jdbc@postgresql.org >> Subject: [JDBC] Connection failed >> >> >> Hi >> >> I am using PostgreSQL 7.0.x Java2 driver on Linux Cobalt with >> JSP web pages. When I connect to localhost I have no problem >> but when I try to connect to Postgresql DB on another machine >> it throws an exception, that is >> java.security.AccessControlException which reports "access >> denied". Does it depend on the driver or what else? >> Thanks for your help. >> >> Agostino De Bellis >> >> >> >> >> >> ---------------------------(end of >> broadcast)--------------------------- >> TIP 1: subscribe and unsubscribe commands go to >> majordomo@postgresql.org >> >> > > > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to >majordomo@postgresql.org) > > >
I don't recognize this as a JDBC message- I think if it were a pg_hba.conf problem, you'd get a different exception. I think you should look elsewhere in the application. -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ > -----Original Message----- > From: pgsql-jdbc-owner@postgresql.org > [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Steve Brett > Sent: Tuesday, July 02, 2002 7:44 AM > To: webmaster; pgsql-jdbc@postgresql.org > Subject: Re: [JDBC] Connection failed > > > i think you might need to check your pg_hba.conf file (in your data > directory) and make sure there is an entry for the machine you are > connecting from . also make sure postgres is started with the '-i' flag to > accept tcp/ip connections ... > > Steve > > > -----Original Message----- > > From: webmaster [mailto:webmaster@nmb-it.net] > > Sent: 28 June 2002 16:35 > > To: pgsql-jdbc@postgresql.org > > Subject: [JDBC] Connection failed > > > > > > Hi > > > > I am using PostgreSQL 7.0.x Java2 driver on Linux Cobalt with > > JSP web pages. When I connect to localhost I have no problem > > but when I try to connect to Postgresql DB on another machine > > it throws an exception, that is > > java.security.AccessControlException which reports "access > > denied". Does it depend on the driver or what else? > > Thanks for your help. > > > > Agostino De Bellis > > > > > > > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to > > majordomo@postgresql.org > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >