I am trying to connect a device (on the same network) to my server so that it
can access the PostgreSQL database. When it tries to connect I get this
error at catalina.out:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Connection refused. Check that the hostname and
port are correct and that the postmaster is accepting TCP/IP connections.)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that
the hostname and port are correct and that the postmaster is accepting
TCP/IP connections.
at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
Here is my network info:
* Server (where apache-tomcast resides) 192.168.5.5
* Device (unix based) 192.168.5.127
Software versions:
* Server - Debian 5
* Postgres - 8.4
* Java (on server) - 1.6.0_17
* Apache-tomcat - 6.0.20
1) I ran netstat on client and server.
CLIENT
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:8181 *:* LISTEN
tcp 0 0 *:telnet *:* LISTEN
tcp 0 0 192.168.5.127:telnet 192.168.5.143:50611
ESTABLISHED
tcp 0 132 192.168.5.127:telnet 192.168.5.143:51391
ESTABLISHED
tcp 0 0 192.168.5.127:51931 192.168.5.5:5222
ESTABLISHED
netstat: no support for 'AF INET6 (tcp)' on this system
netstat: no support for 'AF INET6 (udp)' on this system
raw 0 0 *:255 *:* 0
netstat: no support for 'AF INET6 (raw)' on this system
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 3 [ ] DGRAM 34003 /tmp/log
unix 2 [ ] DGRAM 34005
unix 3 [ ] STREAM CONNECTED 1464
unix 3 [ ] STREAM CONNECTED 1463
SERVER
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:5280 *:* LISTEN
tcp 0 0 linux:7777 *:* LISTEN
tcp 0 0 *:46178 *:* LISTEN
tcp 0 0 *:xmpp-client *:* LISTEN
tcp 0 0 localhost:mysql *:* LISTEN
tcp 0 0 localhost:11211 *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:4369 *:* LISTEN
tcp 0 0 *:xmpp-server *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:postgresql *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:60828 *:* LISTEN
tcp 0 0 localhost:44891 localhost:61613
ESTABLISHED
tcp 0 0 localhost:44893 localhost:61613
ESTABLISHED
tcp 0 0 linux:ssh VAIO.lo:51445 ESTABLISHED
tcp 0 0 linux:ssh VAIO.lo:51443 ESTABLISHED
tcp 0 0 linux:ssh linux1:58261
ESTABLISHED
tcp 0 0 linux:49632 192.168.5.10:telnet
ESTABLISHED
tcp 0 0 linux:xmpp-client 192.168.5.127:42116
ESTABLISHED
tcp 0 0 localhost:35745 localhost:11211
TIME_WAIT
tcp 0 0 linux:ssh VAIO.lo:51551 ESTABLISHED
tcp 0 0 linux:60873 xmpp-client ESTABLISHED
tcp 0 0 linux:xmpp-client 60873 ESTABLISHED
tcp 0 0 localhost:51494 localhost:4369
ESTABLISHED
tcp 0 0 localhost:4369 localhost:51494
ESTABLISHED
tcp 0 0 localhost:44892 localhost:61613
ESTABLISHED
tcp6 0 0 [::]:8161 [::]:* LISTEN
tcp6 0 0 [::]:41025 [::]:* LISTEN
tcp6 0 0 localhost:8005 [::]:* LISTEN
tcp6 0 0 [::]:8009 [::]:* LISTEN
tcp6 0 0 localhost:61613 [::]:* LISTEN
tcp6 0 0 [::]:61616 [::]:* LISTEN
tcp6 0 0 [::]:www [::]:* LISTEN
tcp6 0 0 [::]:8180 [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:postgresql [::]:* LISTEN
tcp6 0 0 linux2.encoreinter:8180 192.168.5.127%136:34510
TIME_WAIT
tcp6 0 0 localhost:61613 localhost:44892
ESTABLISHED
tcp6 0 0 localhost:61613 localhost:44891
ESTABLISHED
tcp6 0 0 localhost:61613 localhost:44893
ESTABLISHED
udp 0 0 *:50048 *:*
udp 0 0 *:syslog *:*
udp 0 0 localhost:11211 *:*
udp 0 0 *:41949 *:*
udp 0 0 *:mdns *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:1022 *:*
udp6 0 0 localhost:45918 localhost:45918
ESTABLISHED
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:59391 [::]:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 332717
/var/run/postgresql/.s.PGSQL.5432
2) I checked pg_hba and the connections are set:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.5.5/24 trust
host all all 192.168.5.127/24 trust
# IPv6 local connections:
host all all ::1/128 trust
3) postgres.conf is configured to listen on to all connections.
# - Connection Settings -
listen_addresses = '*'
port = 5432
What else can I check to get to the bottom of this bug?
--
View this message in context:
http://old.nabble.com/Cannot-create-PoolableConnectionFactory-tp27746714p27746714.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]