java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out: connect

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Oracle Community by 807581, 1 year ago
Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out: connect
via Oracle Community by 843854, 1 year ago
Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
via Oracle Community by 843854, 1 year ago
Unable to connect to any hosts due to exception: java.net.SocketException: Connection reset by peer: connect
via Oracle Community by 843854, 1 year ago
Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
via Google Groups by Mullin, 2 years ago
Server connection failure during transaction. Attempted reconnect 3 times. Giving up.
via Oracle Community by 843810, 1 year ago
Unable to connect to any hosts due to exception: java.net .BindException: Address already in use: connect
java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out: connect
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1631)
at com.mysql.jdbc.Connection.(Connection.java:524)
at com.mysql.jdbc.Driver.connect(Driver.java:359)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:414)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:88)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
at com.sun.enterprise.resource.JdbcXAConnection.(JdbcXAConnection.java:74)
at com.sun.enterprise.resource.SystemJdbc10XaAllocator.createResource(SystemJdbc10XaAllocator.java:52)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
at com.sun.enterprise.resource.SystemJdbcDataSource.internalGetConnection(SystemJdbcDataSource.java:226)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl.getConnection(TransactionHelperImpl.java:171)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnection(EJBHelper.java:169)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getDBName(SQLPersistenceManagerFactory.java:781)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at com.dalcais.domain.TownBean809727498_ConcreteImpl.jdoGetPersistenceManager(TownBean809727498_ConcreteImpl.java:825)
at com.dalcais.domain.TownBean809727498_ConcreteImpl.ejbFindAll(TownBean809727498_ConcreteImpl.java:411)
at com.dalcais.domain.TownBean809727498_ConcreteImpl_LocalHomeImpl.findAll(TownBean809727498_ConcreteImpl_LocalHomeImpl.java:100)
at com.dalcais.apps.re.ListingSessionBean.getAllTowns(ListingSessionBean.java:134)
at com.dalcais.apps.re.ListingSessionBean_EJBObjectImpl.getAllTowns(ListingSessionBean_EJBObjectImpl.java:22)
at com.dalcais.apps.re._ListingSessionBean_EJBObjectImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.