Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql url connection issues

 
kaarthik asokkumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am using jboss 4.2 and mysql (version 5.1) in windows vista. I was successfully connecting to db using the jdbc:mysql://localhost:3306/devpfmdb. how ever suddenly the server fails to connect throwing the below exception. I am not sure why this happend all of the sudden. i reinstalled my mysql but did not make any difference. I used sql explorer as a UI to the database which also failed to connect. I tried changing url connection in the sql explored to jdbc:mysql://127.0.0.1:3306/devpfmdb and it worked but changing that in jboss db did work. Any help would be appreciated.

Last packet sent to the server was 0 ms ago.); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection refused: connect
STACKTRACE:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)

my datasource

- <local-tx-datasource>
<jndi-name>devpfmdb</jndi-name>
<use-java-context>true</use-java-context>
<connection-url>jdbc:mysql://localhost:3306/devpfmdb</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>admin</user-name>
<password>admin</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
- <metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Restart both servers (JBoss and MySQL). Does it work?

If so, then there are some resource leaks in your code. Fix your JDBC code accordingly.
If not, then some firewall (either by hardware or software) has kicked in. Configure its settings to allow the network connection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic