ERROR LogErrorHandler:67 - HSEARCH000058: HSEARCH000212: An exception occurred while the MassIndexer was transforming identifiers to Lucene Documents

Description

While Using MassIndexer rebuilding the whole indices, i think the key is lowercase property type here , My model property definition below:

------------------------------------------------------------------------------------------------------------------------------
private boolean forHubberOnly;

public boolean isForHubberOnly() {
return forHubberOnly;
}

public void setForHubberOnly(boolean forHubberOnly) {
this.forHubberOnly = forHubberOnly;
}

------------------------------------------------------------------------------------------------------------------------------
2016-12-23 12:12:46 INFO SimpleIndexingProgressMonitor:88 - HSEARCH000031: Indexing speed: 59.565620 documents/second; progress: 98.99%
​2016-12-23 12:12:48 ERROR LogErrorHandler:67 - HSEARCH000058: HSEARCH000212: An exception occurred while the MassIndexer was transforming identifiers to Lucene Documents
org.hibernate.PropertyAccessException: Null value was assigned to a property [class com.xxx.models.Event.forHubberOnly] of primitive type setter of com.xxx.models.Event.forHubberOnly
at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:44)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:607)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:220)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:4571)
at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:172)
at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:128)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1132)
at org.hibernate.loader.Loader.processResultSet(Loader.java:992)
at org.hibernate.loader.Loader.doQuery(Loader.java:930)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2611)
at org.hibernate.loader.Loader.doList(Loader.java:2594)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423)
at org.hibernate.loader.Loader.list(Loader.java:2418)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1705)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:175)
at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:140)
at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:117)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Can not set boolean field com.xxx.Event.forHubberOnly to null value
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeBooleanFieldAccessorImpl.set(UnsafeBooleanFieldAccessorImpl.java:80)
at java.lang.reflect.Field.set(Field.java:764)
at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:38)
... 24 more
2016-12-23 12:12:57 INFO SimpleIndexingProgressMonitor:76 - HSEARCH000028: Reindexed 10708 entities

Environment

Hibernate 5.0.1

Activity

Show:
Yoann Rodière
December 23, 2016, 8:05 AM

Hello ,

This seems unrelated to Hibernate Search, since it is an issue with loading data from your database.

From what I can see, you have a column in your database that contains null values, and you mapped this column to a boolean property, which cannot hold null values. Thus Hibernate ORM fails to load the entity when Hibernate Search asks for this entity in order to index it. This seems to be the expected behavior.
You'll probably want to either change your mapping to use a Boolean or to fix you data.

Does it make sense? If it's okay to you, I will close the ticket.

Sanne Grinovero
January 23, 2017, 4:24 PM

I'll mark this resolved as it's not an Hibernate issue. Feel free to reopen if I misunderstood.
Thanks

Assignee

Unassigned

Reporter

Cary.yu

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Affects versions

Priority

Major
Configure