Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

mysql url connection issues

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic