0

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
4

1 に答える 1

0

インターネットで見つけたすべてを試した後。解決策は、Hibernate OGM の使用を停止して、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

于 2015-02-17T16:19:10.420 に答える