Issue with Hibernate 5.2.17.Final with MSQL 8.0.13

Hi Sir
kindly, I have issue with my first exam using Hibernate didn’t running

/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=60775:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/tools.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/out/production/Hibernate-Test-XML:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/jandex-2.0.3.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/jboss-logging-3.3.1.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/jboss-transaction-api_1.2_spec-1.0.1.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/javassist-3.22.0-GA.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/hibernate-core-5.2.17.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/hibernate-commons-annotations-5.0.1.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/classmate-1.3.0.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/dom4j-1.6.1.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/antlr-2.7.7.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar:/Users/wgjamia/IdeaProjects/Hibernate-Test-XML/lib/mysql-connector-java-8.0.13.jar co.edureka.hbm.DataManager
Jan 21, 2019 12:31:04 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.17.Final}
Jan 21, 2019 12:31:04 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Jan 21, 2019 12:31:04 AM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity
WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.
Jan 21, 2019 12:31:04 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Jan 21, 2019 12:31:05 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
Jan 21, 2019 12:31:05 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [com.mysql.cj.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/edureka]
Jan 21, 2019 12:31:05 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=wgjamia, password=****, autocommit=true}
Jan 21, 2019 12:31:05 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: true
Jan 21, 2019 12:31:05 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 1 (min=1)
Jan 21, 2019 12:31:05 AM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect
<<<<===== The Session is Started =====>>>>
Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity: co.edureka.hbm.Branch
	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:787)
	at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:768)
	at co.edureka.hbm.DataManager.main(DataManager.java:23)

Unknown entity: co.edureka.hbm.Branch

You didn’t provide the mapping for this entity co.edureka.hbm.Branch.

This mapping in configuration file

10%20PM

Maybe the configuration file is not found by Hibernate. Try to debug it and see if it’s found. It shpuld be located in the root in your application classpath.

Hi Vlad
Thank you for you effort , kindly, what I have charged this command
ServiceRegistry builder = (ServiceRegistry)
ne StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();

       SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);

To this command is work

 SessionFactory sessionFactory = configuration.buildSessionFactory();

27%20PM

I’m sorry “why” no “what”

Check out the Getting started guide for an example that works just fine.