This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JBoss/WildFly and the fly likes mysql url connection issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "mysql url connection issues" Watch "mysql url connection issues" New topic
Author

mysql url connection issues

kaarthik asokkumar
Greenhorn

Joined: Jan 21, 2005
Posts: 29
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>


SCJP 1.4, SCWCD 1.4,SCBCD 1.3.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
 
wood burning stoves
 
subject: mysql url connection issues