Hi,
I'm getting
Code:
ERROR LogErrorHandler.handleException(83) | HSEARCH000058: HSEARCH000116: Unexpected error during MassIndexer operation
org.hibernate.search.bridge.BridgeException: Exception while calling bridge#set
class: nl.project.model.Post
path: likes.like.user.
at org.hibernate.search.bridge.util.impl.ContextualExceptionBridgeHelper.buildBridgeException(ContextualExceptionBridgeHelper.java:97)
at org.hibernate.search.bridge.util.impl.ContextualExceptionBridgeHelper$OneWayConversionContextImpl.set(ContextualExceptionBridgeHelper.java:126)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:501)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:581)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:479)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:402)
at org.hibernate.search.batchindexing.impl.EntityConsumerLuceneWorkProducer.index(EntityConsumerLuceneWorkProducer.java:172)
at org.hibernate.search.batchindexing.impl.EntityConsumerLuceneWorkProducer.indexAllQueue(EntityConsumerLuceneWorkProducer.java:132)
at org.hibernate.search.batchindexing.impl.EntityConsumerLuceneWorkProducer.run(EntityConsumerLuceneWorkProducer.java:102)
at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:112)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: nl.project.model.User.roles, no session or session was closed
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:393)
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:385)
at org.hibernate.collection.internal.AbstractPersistentCollection.readElementExistence(AbstractPersistentCollection.java:160)
The referenced code is
Code:
public class User{
@ManyToMany(cascade=CascadeType.MERGE,fetch = FetchType.LAZY)
@JoinTable(name = "ABC", joinColumns = @JoinColumn(nullable = false), inverseJoinColumns = @JoinColumn(nullable = false))
@Fetch(FetchMode.SUBSELECT)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE,region=CacheRegion.USER)
@IndexedEmbedded(prefix="role.")
public Set<UserRole> getRoles() {
return roles;
}
public class Post{
@OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
@JoinTable(name = "XYZ"
,joinColumns=@JoinColumn(name="PId")
,inverseJoinColumns=@JoinColumn(name="UId")
)
@BatchSize(size=5)
@IndexedEmbedded(prefix="like.user.",includePaths={"id","nickName"})
public Set<User> getLikes() {
return likes;
}
I'm using HSearch 4.1CR3
Both User and Post are @Indexed entities and both are using fields with the includePaths property which, as referenced by HSEARCH 1049 can create problems in some cases. I'm wondering if this is causing it.
Any ideas?
Kind regards,
Marc