pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem accessing databse via servlets
2+ messages / 2 participants
[nested] [flat]

* Problem accessing databse via servlets
@ 1999-09-27 12:35  Anders Svensson <anders@simusoft.dk>
  0 siblings, 1 reply; 2+ messages in thread

From: Anders Svensson @ 1999-09-27 12:35 UTC (permalink / raw)
  To: pgsql-interfaces

Does anyone have any solution to my problem.

I have 2 servlets, with basicly the same code for the database interface.
My problem is that one works the others doesn't.

I have

local        all                                         trust
host         all         127.0.0.1     255.255.255.255   trust
host         all         192.168.1.0   255.255.255.0     trust

for testing in my pg_hba.conf file.

The servlets are accesing two different databases, and when i run the one
that doesn't work i get the following meesage in my apache error_log

The backend has broken the connection. Possibly the action you have
attempted h\
as caused it to close.
        at postgresql.PG_Stream.ReceiveChar(PG_Stream.java:178)
        at postgresql.Connection.openConnection(Connection.java:219)
        at postgresql.Driver.connect(Driver.java:116)
        at java.sql.DriverManager.getConnection(DriverManager.java:457)
        at java.sql.DriverManager.getConnection(DriverManager.java:137)
        at Flykend.dbConn.<init>(dbConn.java)
        at Flykending.init(Flykending.java)
        at
org.apache.jserv.JServServletManager.load_init(JServServletManager.j\ava:478)

at
org.apache.jserv.JServServletManager.loadServlet(JServServletManager\.java:397)

at
org.apache.jserv.JServConnection.processRequest(JServConnection.java\:287)
        at org.apache.jserv.JServConnection.run(JServConnection.java:197)
        at java.lang.Thread.run(Thread.java:479)


The funny thing ?? is that the trouble program works if it is not run from
a servlet, but from a command line????????
Simu Soft
v/Anders Svensson
Frederikssundsvej 20, 2 th
DK-2400  København NV

e-mail 	: Anders@simusoft.dk
tlf.	: +45 3583 8126




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] Problem accessing databse via servlets
@ 1999-09-27 13:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Anders Svensson <anders@simusoft.dk>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 1999-09-27 13:57 UTC (permalink / raw)
  To: Anders Svensson <anders@simusoft.dk>; +Cc: pgsql-interfaces

Anders Svensson <anders@simusoft.dk> writes:
> I have 2 servlets, with basicly the same code for the database interface.
> My problem is that one works the others doesn't.
> The funny thing ?? is that the trouble program works if it is not run from
> a servlet, but from a command line????????

Strictly a guess, but: I recall a similar complaint which turned out
to be due to some kind of "virtual hosting" setup on the web server.
The net effect was that the applet appeared to be connecting from a
different IP address than the user thought it would be connecting from,
and of course that virtual IP address wasn't listed in pg_hba.conf.

If you are running a recent Postgres release (I think >= 6.5 but maybe
this is in >= 6.5.1) the postmaster log should show the IP address that
it saw the connection as coming from, so you can check this theory by
looking in the logfile.

The same message is echoed back to the client, BTW, but apparently the
jserv code thinks it should protect your innocent eyes by not showing
you the server error message :-(

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-09-27 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-27 12:35 Problem accessing databse via servlets Anders Svensson <anders@simusoft.dk>
1999-09-27 13:57 ` Tom Lane <tgl@sss.pgh.pa.us>

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