]
Sanne Grinovero commented on HSEARCH-1095:
------------------------------------------
Ok it seems to happen only on first series of index updates, and only if no query was
every run before.
Near Real Time produces NullPointerExceptions in background worker
thread on flush at first operation when no search ever happened
----------------------------------------------------------------------------------------------------------------------------------
Key: HSEARCH-1095
URL:
https://hibernate.onjira.com/browse/HSEARCH-1095
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Reporter: Emmanuel Bernard
Assignee: Sanne Grinovero
Labels: candidate_for_next
{code}
13:34:02,078 ERROR [org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask]
(Hibernate Search: Index updates queue processor for index
org.jboss.as.quickstarts.kitchensink.model.Member-1) HSEARCH000073: Error in backend:
java.lang.NullPointerException
at
org.hibernate.search.backend.impl.lucene.NRTWorkspaceImpl.flush(NRTWorkspaceImpl.java:171)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.NRTWorkspaceImpl.afterTransactionApplied(NRTWorkspaceImpl.java:79)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:138)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
[classes.jar:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[classes.jar:1.6.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[classes.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]
13:34:02,099 ERROR [org.hibernate.search.exception.impl.LogErrorHandler] (Hibernate
Search: Index updates queue processor for index
org.jboss.as.quickstarts.kitchensink.model.Member-1) HSEARCH000058: Exception occurred
java.lang.NullPointerException
Primary Failure:
Entity org.jboss.as.quickstarts.kitchensink.model.Member Id 1 Work Type
org.hibernate.search.backend.AddLuceneWork
Subsequent failures:
Entity org.jboss.as.quickstarts.kitchensink.model.Member Id 2 Work Type
org.hibernate.search.backend.AddLuceneWork
Entity org.jboss.as.quickstarts.kitchensink.model.Member Id 3 Work Type
org.hibernate.search.backend.AddLuceneWork
Entity org.jboss.as.quickstarts.kitchensink.model.Member Id 4 Work Type
org.hibernate.search.backend.AddLuceneWork
java.lang.NullPointerException
at
org.hibernate.search.backend.impl.lucene.NRTWorkspaceImpl.flush(NRTWorkspaceImpl.java:171)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.NRTWorkspaceImpl.afterTransactionApplied(NRTWorkspaceImpl.java:79)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:138)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at
org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
[hibernate-search-engine-4.1.0.Final.jar:4.1.0.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
[classes.jar:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[classes.jar:1.6.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[classes.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]
{code}
{code}@Entity
@XmlRootElement
@Table(uniqueConstraints = @UniqueConstraint(columnNames = "email"))
@Indexed
public class Member implements Serializable {
/** Default value included to remove warning. Remove or modify at will. **/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
private Long id;
@NotNull
@Size(min = 1, max = 25)
@Pattern(regexp = "[A-Za-z ]*", message = "must contain only letters
and spaces")
@Field
private String name;
@NotNull
@NotEmpty
@Email
private String email;
@NotNull
@Size(min = 10, max = 12)
@Digits(fraction = 0, integer = 12)
@Column(name = "phone_number")
private String phoneNumber;
@NotEmpty
@Size(min = 2, max = 50)
@Field
private String location;
@NotEmpty
@Size(min = 2, max = 50)
@Field
private String job;
{code}
{code}<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<!-- If you are running in a production environment, add a managed
data source, this example data source is just for development and testing!
-->
<!-- The datasource is deployed as WEB-INF/kitchensink-quickstart-ds.xml, you
can find it in the source at
src/main/webapp/WEB-INF/kitchensink-quickstart-ds.xml -->
<jta-data-source>java:jboss/datasources/KitchensinkQuickstartDS</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto"
value="create-drop" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.search.default.indexmanager"
value="near-real-time"/>
<property name="hibernate.search.default.directory_provider"
value="ram"/>
</properties>
</persistence-unit>
</persistence>
{code}
When I comment <property name="hibernate.search.default.indexmanager"
value="near-real-time"/>, it works
--
This message is automatically generated by JIRA.
For more information on JIRA, see: