Jdbc - can't connect to MySQL db on localhost

1

I am a beginner in Java and I am trying to run a GWT app, which was not written by me, but I know the code should be working. When starting development server with gwt:run, everything seems to work but there is no DB connection and I am getting JDBC errors.

[ERROR] kwi 21, 2018 3:54:08 AM java.util.prefs.WindowsPreferences <init>
[ERROR] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] 2018-04-21 03:54:11,805 ERROR Could not perform database startup operations using logging manager [jdbcManager{ description=databaseAppender, bufferSize=0, connectionSource=factory{ public static java.sql.Connection com.mcrawler.crawler.database.ConnectionFactory.getDatabaseConnection() }, tableName=EventLog, columns=[ { name=eventDate, layout=null, literal=null, timestamp=true }, { name=level, layout=%level, literal=null, timestamp=false }, { name=logger, layout=%logger, literal=null, timestamp=false }, { name=message, layout=%message, literal=null, timestamp=false }, { name=exception, layout=%ex{full}, literal=null, timestamp=false } ] }]. java.sql.SQLException: Failed to obtain connection from factory method.
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource$1.getConnection(FactoryMethodConnectionSource.java:107)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource.getConnection(FactoryMethodConnectionSource.java:53)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.startupInternal(JdbcDatabaseManager.java:60)
[INFO]  at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.startup(AbstractDatabaseManager.java:64)
[INFO]  at org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender.start(AbstractDatabaseAppender.java:89)
[INFO]  at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:168)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:359)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:420)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
[INFO]  at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
[INFO]  at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
[INFO]  at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
[INFO]  at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:102)
[INFO]  at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
[INFO]  at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
[INFO]  at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
[INFO]  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:285)
[INFO]  at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:38)
[INFO]  at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:32)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at java.lang.Class.newInstance(Class.java:442)
[INFO]  at org.eclipse.jetty.util.log.Log.initialized(Log.java:161)
[INFO]  at org.eclipse.jetty.util.log.Log.getLogger(Log.java:435)
[INFO]  at org.eclipse.jetty.util.log.Log.getLogger(Log.java:425)
[INFO]  at org.eclipse.jetty.servlet.listener.ELContextCleaner.<clinit>(ELContextCleaner.java:43)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at java.lang.Class.newInstance(Class.java:442)
[INFO]  at org.eclipse.jetty.server.handler.ContextHandler$Context.createListener(ContextHandler.java:2375)
[INFO]  at org.eclipse.jetty.servlet.ServletContextHandler$Context.createListener(ServletContextHandler.java:1227)
[INFO]  at org.eclipse.jetty.webapp.StandardDescriptorProcessor.newListenerInstance(StandardDescriptorProcessor.java:1908)
[INFO]  at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1865)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:85)
[INFO]  at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:72)
[INFO]  at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:366)
[INFO]  at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1240)
[INFO]  at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
[INFO]  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
[INFO]  at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:541)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
[INFO]  at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:165)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
[INFO]  at org.eclipse.jetty.server.Server.doStart(Server.java:282)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:740)
[INFO]  at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:522)
[INFO]  at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1104)
[INFO]  at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:844)
[INFO]  at com.google.gwt.dev.DevMode.main(DevMode.java:322)
[INFO] Caused by: java.lang.reflect.InvocationTargetException
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource$1.getConnection(FactoryMethodConnectionSource.java:105)
[INFO]  ... 59 more
[INFO] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
[INFO]  at com.mysql.jdbc.Util.getInstance(Util.java:360)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
[INFO]  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2311)
[INFO]  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
[INFO]  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
[INFO]  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
[INFO]  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
[INFO]  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
[INFO]  at java.sql.DriverManager.getConnection(DriverManager.java:664)
[INFO]  at java.sql.DriverManager.getConnection(DriverManager.java:247)
[INFO]  at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75)
[INFO]  at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
[INFO]  at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
[INFO]  at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
[INFO]  at com.mcrawler.crawler.database.ConnectionFactory.getDatabaseConnection(ConnectionFactory.java:51)
[INFO]  ... 64 more
[INFO] Caused by: java.lang.NullPointerException
[INFO]  at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:2983)
[INFO]  at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1873)
[INFO]  at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1802)
[INFO]  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
[INFO]  at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
[INFO]  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
[INFO]  ... 81 more
[INFO] 
[INFO] 2018-04-21 03:54:12,036 ERROR Could not perform database startup operations using logging manager [jdbcManager{ description=databaseAppender, bufferSize=0, connectionSource=factory{ public static java.sql.Connection com.mcrawler.crawler.database.ConnectionFactory.getDatabaseConnection() }, tableName=EventLog, columns=[ { name=eventDate, layout=null, literal=null, timestamp=true }, { name=level, layout=%level, literal=null, timestamp=false }, { name=logger, layout=%logger, literal=null, timestamp=false }, { name=message, layout=%message, literal=null, timestamp=false }, { name=exception, layout=%ex{full}, literal=null, timestamp=false } ] }]. java.sql.SQLException: Failed to obtain connection from factory method.
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource$1.getConnection(FactoryMethodConnectionSource.java:107)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource.getConnection(FactoryMethodConnectionSource.java:53)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.startupInternal(JdbcDatabaseManager.java:60)
[INFO]  at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.startup(AbstractDatabaseManager.java:64)
[INFO]  at org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender.start(AbstractDatabaseAppender.java:89)
[INFO]  at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:168)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:359)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:420)
[INFO]  at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
[INFO]  at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
[INFO]  at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
[INFO]  at org.apache.logging.log4j.LogManager.getContext(LogManager.java:262)
[INFO]  at org.apache.log4j.Logger$PrivateManager.getContext(Logger.java:59)
[INFO]  at org.apache.log4j.Logger.getLogger(Logger.java:37)
[INFO]  at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:262)
[INFO]  at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1025)
[INFO]  at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:844)
[INFO]  at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
[INFO]  at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
[INFO]  at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
[INFO]  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
[INFO]  at org.apache.jasper.servlet.JspServlet.<clinit>(JspServlet.java:58)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at java.lang.Class.newInstance(Class.java:442)
[INFO]  at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1075)
[INFO]  at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:957)
[INFO]  at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:514)
[INFO]  at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
[INFO]  at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
[INFO]  at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
[INFO]  at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
[INFO]  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
[INFO]  at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:541)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
[INFO]  at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:165)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
[INFO]  at org.eclipse.jetty.server.Server.doStart(Server.java:282)
[INFO]  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
[INFO]  at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:740)
[INFO]  at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:522)
[INFO]  at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1104)
[INFO]  at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:844)
[INFO]  at com.google.gwt.dev.DevMode.main(DevMode.java:322)
[INFO] Caused by: java.lang.reflect.InvocationTargetException
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource$1.getConnection(FactoryMethodConnectionSource.java:105)
[INFO]  ... 54 more
[INFO] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
[INFO]  at com.mysql.jdbc.Util.getInstance(Util.java:360)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
[INFO]  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
[INFO]  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2311)
[INFO]  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
[INFO]  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
[INFO]  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[INFO]  at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
[INFO]  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
[INFO]  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
[INFO]  at java.sql.DriverManager.getConnection(DriverManager.java:664)
[INFO]  at java.sql.DriverManager.getConnection(DriverManager.java:247)
[INFO]  at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75)
[INFO]  at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
[INFO]  at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
[INFO]  at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
[INFO]  at com.mcrawler.crawler.database.ConnectionFactory.getDatabaseConnection(ConnectionFactory.java:51)
[INFO]  ... 59 more
[INFO] Caused by: java.lang.NullPointerException
[INFO]  at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:2983)
[INFO]  at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1873)
[INFO]  at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1802)
[INFO]  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
[INFO]  at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
[INFO]  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
[INFO]  ... 76 more

I have MySQL installed and have created database crawldb using root user. The password of the root user is password. I can login to MySQL from shell and can see the database. Here is the application code which seems to specify connection settings:

<hibernate-configuration>

    <session-factory>

        <!-- MySQL localhost -->
        <property name='connection.driver_class'>com.mysql.jdbc.Driver</property>
        <property name='connection.url'>jdbc:mysql://localhost:3306/crawldb</property>
        <property name='connection.username'>root</property>
        <property name='connection.password'>password</property>
        <property name='dialect'>org.hibernate.dialect.MySQLDialect</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="c3p0.min_size">3</property>
        <property name="c3p0.max_size">15</property>
        <property name="c3p0.acquire_increment">2</property>
        <property name="c3p0.idle_test_period">3000</property>
        <property name="c3p0.max_statements">50</property>
        <property name="c3p0.timeout">1800</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache  -->
        <property name="hibernate.cache.use_second_level_cache">false</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">false</property>

        <property name="default_batch_fetch_size">128</property>
        <property name="jdbc.batch_size">24</property>

    </session-factory>

</hibernate-configuration>

In pom.xml there is a dependency for mysql-connector-java:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.34</version>
</dependency>
java
mysql
jdbc
gwt
asked on Stack Overflow Apr 21, 2018 by mck

1 Answer

1

As Mark Rotteveel suggested in the comments, the version of Connector/J in my pom.xml was pretty old (5.1.34) compared to MySQL version installed on my system (8.0.11), which turned out to be a buggy combination.

The solution was to either use newer version of Connector/J or downgrade the MySQL version on my machine. I ended up choosing the latter and installed MySQL 5.5 , because I needed to run the app without modifying any project files.

answered on Stack Overflow Apr 22, 2018 by mck

User contributions licensed under CC BY-SA 3.0