在Glassfish 4.1上使用Hibernate OGM,MongoDB和JTA。当试图坚持得到一个错误:
Caused by: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: could not get a field value by reflection getter
和
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String field br.com.juliocnsouza.mongojpaexemple.model.Developer.id to br.com.juliocnsouza.mongojpaexemple.model.Developer
答案 0 :(得分:0)
尝试了我在互联网上发现的每一件事。解决方案是停止使用Hibernate OGM e eclipselink NoSQL。刚刚添加了一个新的依赖项并更改了我的持久性xml的一些部分,现在它的工作正常!
https://wiki.eclipse.org/EclipseLink/Examples/JPA/NoSQL
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.nosql</artifactId>
<version>2.6.0-M3</version>
</dependency>
简单示例项目:https://github.com/juliocnsouzadev/hibernateMongoDB/tree/master/OgmJpaMongodbEclipseLink