JPA Hibernate Persistence exception [PersistenceUnit: default] Unable to build Hibernate SessionFactory

The Solution to JPA Hibernate Persistence exception [PersistenceUnit: default] Unable to build Hibernate SessionFactory is


The issue is that you are not able to get a connection to MYSQL database and hence it is throwing an error saying that cannot build a session factory.

Please see the error below:

 Caused by: java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) 

which points to username not getting populated.

Please recheck system properties

dataSource.setUsername(System.getProperty("root"));

some packages seems to be missing as well pointing to a dependency issue:

package org.gjt.mm.mysql does not exist

Please run a mvn dependency:tree command to check for dependencies

~ Answered on 2016-05-23 10:38:52


Most Viewed Questions: