Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in RESOURCE hibernate.cfg.xml. Message: null
at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:133)
at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:133)
2016-05-08
删除服务注册对象serviceRegistry,直接用config生成sessionFactory就可以了:
sessionFactory=config.buildSessionFactory();
sessionFactory=config.buildSessionFactory();
2016-05-05
(接上一条评论)
Metadata metadata = new MetadataSources(standardRegistry).getMetadataBuilder()
.applyImplicitNamingStrategy(ImplicitNamingStrategyJpaCompliantImpl.INSTANCE).build();
sessionFactory=metadata.getSessionFactoryBuilder().build();
Metadata metadata = new MetadataSources(standardRegistry).getMetadataBuilder()
.applyImplicitNamingStrategy(ImplicitNamingStrategyJpaCompliantImpl.INSTANCE).build();
sessionFactory=metadata.getSessionFactoryBuilder().build();
2016-05-05
如果遇到报错可以尝试以下方法,用metadata生成sessionFactory,不使用原来的config和serviceRegistry,改成以下语句:
StandardServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().configure().build();
(见下一条评论)
StandardServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().configure().build();
(见下一条评论)
2016-05-05
java.lang.AbstractMethodError: Method com/mysql/jdbc/PreparedStatement.setBinaryStream(ILjava/io/InputStream;J)V is abstract
出现以上错误,自行下载mysql-connector-java-bin5.1.7版本进行替换,可解决问题。
出现以上错误,自行下载mysql-connector-java-bin5.1.7版本进行替换,可解决问题。
2016-05-03