-
1. Re: mysql datasource in wildfly-10.0.0
mayerw01 Apr 26, 2016 5:32 AM (in response to aleks)Did you verify that you are able to connect to this database via mysql?
mysql -h mysqlhost.mydomain mydatabase
-
2. Re: mysql datasource in wildfly-10.0.0
aleks Apr 26, 2016 6:22 AM (in response to mayerw01)Yes, I verified it, and it works.
I can enter the mysql from wildfly server with mysql command.
There are no any firewall on wildfly or mysql server hosts.
-
3. Re: mysql datasource in wildfly-10.0.0
mayerw01 Apr 26, 2016 6:45 AM (in response to aleks)Did you also try to replace the hostname with the IP-address?
Which messages do you get in the server.log?
-
4. Re: mysql datasource in wildfly-10.0.0
aleks Apr 26, 2016 7:00 AM (in response to mayerw01)Yes, I have tried to replace mysqlhost.mydomain with ip address, but result is the same.
I have tried also to tcpdump traffic between wildfly and mysqlhost.mydomain hosts during wildfly startup,
but traffic is absent.
The exact exception in the server log file is:
2016-04-26 13:55:44,519 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) IJ000610: Unable to fill pool: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:343)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:350)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:285)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1319)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.fillTo(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1135)
at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:981)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:339)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2286)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:422)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:134)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:312)
... 6 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:298)
... 21 more
I must say that if I start wildfly- 9.0.2 server from the same host as wildfly-10.0.0 than all works fine, connection to mysqlhost.mydomain is established.
-
5. Re: mysql datasource in wildfly-10.0.0
mayerw01 Apr 26, 2016 9:50 AM (in response to aleks)Did you check your pool settiings?
-
6. Re: mysql datasource in wildfly-10.0.0
aleks Apr 26, 2016 2:05 PM (in response to mayerw01)standalone.xml:
<pool>
<min-pool-size>20</min-pool-size>
<initial-pool-size>20</initial-pool-size>
<max-pool-size>150</max-pool-size>
<prefill>true</prefill>
</pool>
my.cnf:
max_connections=500
-
7. Re: mysql datasource in wildfly-10.0.0
rcd Apr 26, 2016 3:37 PM (in response to aleks)Does your configuration have datasource-class defined? If yes, then you are probably affected by WFLY-6157. The comments on that issue explain how to fix the problem.
-
8. Re: mysql datasource in wildfly-10.0.0
aleks Apr 27, 2016 2:00 AM (in response to rcd)I have added to standalone.xml
<connection-property name="ServerName">mysqlhost.mydomain:</connection-property>
<connection-property name="Port">3306</connection-property>
<connection-property name="DatabaseName">mydatabase</connection-property>
Now all works. Thanks a lot for help!