Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hibernate not found mysql class in maven project
- Session session = HibernateUtil.getSessionFactory().openSession();
- session.beginTransaction();
- session.getTransaction().commit();
- Exception in thread "main" java.lang.ExceptionInInitializerError
- at net.leemoo.test.HibernateUtil.buildSessionFactory(HibernateUtil.java:19)
- at net.leemoo.test.HibernateUtil.<clinit>(HibernateUtil.java:8)
- at net.leemoo.test.MainClass.main(MainClass.java:9)
- Caused by: org.hibernate.HibernateException: Dialect class not found: jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
- at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:76)
- at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:64)
- at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:166)
- at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
- at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
- at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
- at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
- at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
- at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
- at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
- at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
- at net.leemoo.test.HibernateUtil.buildSessionFactory(HibernateUtil.java:13)
- ... 2 more
- Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8]
- at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:141)
- at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:73)
- ... 13 more
- Caused by: java.lang.ClassNotFoundException: Could not load requested class : jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
- at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$1.findClass(ClassLoaderServiceImpl.java:99)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)
- ... 14 more
- Caused by: java.lang.ClassNotFoundException:
- Could not load requested class :
- jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
- Dialect class not found: jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
Add Comment
Please, Sign In to add comment