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

后端 未结 4 1391
情书的邮戳
情书的邮戳 2020-12-20 11:45

I\'ve been trying to sort out a connection to my DB with JPA Hibernate and mysql, but for some reason, no matter what i try, when launching the tomcat server i get the same

4条回答
  •  难免孤独
    2020-12-20 12:01

    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

提交回复
热议问题