删除服务注册对象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
测试的时候,显示缺少hamcrestjava.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing...报错真的是无处不在
2016-04-30