List list = criteria.getExecutableCriteria(session). Session.beginTransaction() // This is the line where the exception occurs SessionFactory sf = HibernateUtil.getSessionFactory() The method in which I access the database: public static List getList(DetachedCriteria criteria) Jdbc:mysql://localhost/ws?autoReconnect=true&user=user&password=pw Nevertheless, my timeout values are: connect_timeout: 10 Also, working with phpmyadmin never caused any problems. My problems seems different since it says the last package received was 0ms ago. Having looked through other threads, other people had problems with the timeout. : Could not open connectionĪt .nvert(SQLStateConversionDelegate.java:132)Īt .nvert(StandardSQLExceptionConverter.java:49)Īt .(SqlExceptionHelper.java:125)Īt .(SqlExceptionHelper.java:110)Īt .(LogicalConnectionImpl.java:221)Īt .(LogicalConnectionImpl.java:157)Īt .(JdbcTransaction.java:67)Īt .(AbstractTransactionImpl.java:160)Īt .beginTransaction(SessionImpl.java:1432)Īt de.(HibernateUtil.java:230)Īt de.(LoginCommand.java:35)Īt de.(LoginCommand.java:20)Īt de.(SessionManager.java:142)Īt de.(SessionManager.java:124)Īt de.(CommandExecutionThread.java:27)Ĭaused by: .jdbc4.CommunicationsException: Communications link failureĪt 0(Native Method)Īt (NativeConstructorAccessorImpl.java:57)Īt (DelegatingConstructorAccessorImpl.java:45)Īt .newInstance(Constructor.java:525)Īt .handleNewInstance(Util.java:411)Īt .createCommunicationsException(SQLError.java:1121)Īt .(MysqlIO.java:357)Īt .coreConnect(ConnectionImpl.java:2482)Īt .connectOneTryOnly(ConnectionImpl.java:2519)Īt .createNewIO(ConnectionImpl.java:2304)Īt .(ConnectionImpl.java:834)Īt 4Connection.(JDBC4Connection.java:47)Īt .getInstance(ConnectionImpl.java:416)Īt .connect(NonRegisteringDriver.java:346)Īt .(DriverManagerConnectionProviderImpl.java:204)Īt $NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292)Īt .(LogicalConnectionImpl.java:214)Ĭaused by: : Connection refusedĪt (Native Method)Īt (AbstractPlainSocketImpl.java:339)Īt (AbstractPlainSocketImpl.java:200)Īt (AbstractPlainSocketImpl.java:182)Īt (SocksSocketImpl.java:391)Īt (Socket.java:579)Īt (Socket.java:528)Īt .connect(StandardSocketFactory.java:259)Īt .(MysqlIO.java:307) The driver has not received any packets from the server. The last packet sent successfully to the server was 0 milliseconds ago. The initial connection to the database works fine, but as soon as the first query is send to the database, I get this error: 10:55:24 AM .spi.SqlExceptionHelper logExceptionsġ0:55:24 AM .spi.SqlExceptionHelper logExceptions By removing MYSQLUSERroot from the docker-compose.yaml file, the problem was resolved, and the database connection was established successfully. I want to start my program on an external computer. ERROR Entrypoint: MYSQLUSER'root', MYSQLUSER and MYSQLPASSWORD are for configuring a regular user and cannot be used for the root user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |