开发者

JBoss (only) and PostgreSQL : Connection refused

开发者 https://www.devze.com 2023-02-21 00:25 出处:网络
I\'ve a problem with my JBoss-Server connecting to DB with PostgreSQL. When I start the JBOSS-Server (which runs local) within Eclipse, I always get the exception:

I've a problem with my JBoss-Server connecting to DB with PostgreSQL. When I start the JBOSS-Server (which runs local) within Eclipse, I always get the exception: Connection refused (check for correct hostname and portnumber and TCP/IP connection)

I tried to allow every connection with PostgreSQL by adapting the pg_hba.conf, but that didn't worked out for me.

I'm using Windows 7, JBoss 6.0.0 and PostgreSQL 9.0. I also tried to turn off the Windows-Firewall without success.

Has anybody an idea, what the problem here could be?

  • pgadmin works fine

The XML looks like this:

<datasource>
 <xa-datasource>
  <jndi-name>MYNAME</jndi-name>
  <track-connection-by-tx开发者_开发百科/>
  <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
  <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
  <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
  <xa-datasource-property name="DatabaseName">myName</xa-datasource-property>
  <xa-datasource-property name="User">postgres</xa-datasource-property>
  <xa-datasource-property name="Password">*****</xa-datasource-property>
 </xa-datasource>
</datasource>

P.S.: with the same configuration the whole thing runs on my school computer (also Win 7)


Connection refused means connection refused. This means that the connection was attempted and the application got an ICMP packet back saying that the connection was refused. There are a number of reasons this might happen but this is, in effect, network troubleshooting.

  1. Your config suggests that you are trying to connect to localhost. Are you really trying to connect to a different host and just didn't specify that right?

  2. Are there any firewalls on the host or between them? If so disable them for troubleshooting purposes.

  3. If this doesn't help, using tracert can often help narrow down the problem, which could be between the hosts.

0

精彩评论

暂无评论...
验证码 换一张
取 消