-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Unable to remove from Lucene index
PostPosted: Wed Jan 27, 2010 3:25 am 
Newbie

Joined: Wed Jan 27, 2010 3:07 am
Posts: 3
I have a problem using hibernate search. Please help.
I have three class.
Code:
@Entity
@Table
@Indexed(index = "archiveinfo")
@Analyzer(impl = jeasy.analysis.MMAnalyzer.class)
public class ArchiveInfo  implements java.io.Serializable {
   @Id
   @DocumentId
   @GeneratedValue
     private Long archId;
    @OneToMany
    @IndexedEmbedded(prefix="efile_", depth=1)
     private Set<Efile> efiles = new HashSet<Efile>();

     @OneToMany
     @IndexedEmbedded(prefix="land_", depth=1)
     private Set<LandAccess> landaccesses = new HashSet<LandAccess>();
     ........
}

@Entity
@Table
@Indexed(index = "efile")
@Analyzer(impl = jeasy.analysis.MMAnalyzer.class)
public class Efile  implements java.io.Serializable {

   @Id
   @DocumentId
   @GeneratedValue
         private Long fileId;

         @ManyToOne
    @ContainedIn
    @IndexedEmbedded(prefix="archive_", depth=1)
         private ArchiveInfo archiveinfo;
         .........
}
@Entity
@Table
@Indexed(index = "landaccess")
@Analyzer(impl = jeasy.analysis.MMAnalyzer.class)
public class LandAccess implements java.io.Serializable {
   
   @Id
   @DocumentId
   @GeneratedValue
   private Long laId;

   @ManyToOne
   @ContainedIn
   @IndexedEmbedded(prefix="archive_", depth=1)
   private ArchiveInfo archiveinfo;
        .........
}

When i insert a LandAccess, there is no problem. But when i then update it, there will be an exception occured. How can i do to solve it? please help.
Code:
[org.hibernate.transaction.JDBCTransaction]-[ERROR] exception calling user Synchronization
org.hibernate.search.SearchException: Unable to remove from Lucene index: class org.archivebase.mappings.ArchiveInfo#null
   at org.hibernate.search.backend.impl.lucene.LuceneWorker.remove(LuceneWorker.java:109)
   at org.hibernate.search.backend.impl.lucene.LuceneWorker.performWork(LuceneWorker.java:80)
   at org.hibernate.search.backend.impl.lucene.LuceneWorker.performWork(LuceneWorker.java:46)
   at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueProcessor.run(LuceneBackendQueueProcessor.java:98)
   at org.hibernate.search.backend.impl.BatchedQueueingProcessor.performWorks(BatchedQueueingProcessor.java:149)
   at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:50)
   at org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsAfterTransactionCompletion(JDBCTransaction.java:289)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:152)
   at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy28.updateLandAccess(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
   at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
   at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
   at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:898)
   at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
   at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
   at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
   at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
   at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:147)
   at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
   at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
   at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:78)
   at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:153)
   at org.apache.lucene.index.TermInfosReader.scanEnum(TermInfosReader.java:223)
   at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:217)
   at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:54)
   at org.apache.lucene.index.MultiSegmentReader$MultiTermDocs.termDocs(MultiSegmentReader.java:604)
   at org.apache.lucene.index.MultiSegmentReader$MultiTermDocs.next(MultiSegmentReader.java:555)
   at org.hibernate.search.backend.impl.lucene.LuceneWorker.remove(LuceneWorker.java:99)
   ... 51 more


Top
 Profile  
 
 Post subject: Re: Unable to remove from Lucene index
PostPosted: Wed Jan 27, 2010 4:42 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Which version of Hibernate Search are you using? And can you post your indexing code? How do you know that inserting LandAccess worked? Can you successfully query it?

Not knowing what your usecases are, but do you really need indexes for all objects? Which are the entities you are searching for?

--Hardy


Top
 Profile  
 
 Post subject: Re: Unable to remove from Lucene index
PostPosted: Fri Jan 29, 2010 5:42 am 
Newbie

Joined: Wed Jan 27, 2010 3:07 am
Posts: 3
I want to search ArchiveInfo . i use hibernate search 3.0.1.
When i insert an LandAccess, i can use the keyword to query it successfully, and all work well. And i can query ArchiveInfo though the landaccess that i just inserted.
But then when i update the landaccess, the SearchException occurs. I have no idea why this happened.
That I index there objects is the system requirements. Can you give me some advice. Thank you.


Top
 Profile  
 
 Post subject: Re: Unable to remove from Lucene index
PostPosted: Fri Jan 29, 2010 10:27 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Ok, here are some ideas and questions ;-)

What the error message says is that Hibernate Search tries to delete an instance of org.archivebase.mappings.ArchiveInfo from the index with an id of null. The question is why the id is null. Of course no such entity exists in the index. The question is why this is happening. It would be interesting to see your Hibernate Search configuration (annotated classes) and how exactly you are updating the entity. Where are your transaction boundaries?

Next question I have is why you run such an old version of Hibernate Search? the latest version is 3.1.1 GA and I highly recommend to upgrade!

If you search on ArchiveInfo you don't really need to index LandAccess. @Indexed and @IndexedEmbedded in LandAccess seem unnecessary. If you are never search directly for LandAccess they are not needed (at least that's the case in the latest Search version).

--Hardy


Top
 Profile  
 
 Post subject: Re: Unable to remove from Lucene index
PostPosted: Sun Jan 31, 2010 12:26 am 
Newbie

Joined: Wed Jan 27, 2010 3:07 am
Posts: 3
Thanks. I will try to upgrade the Hibernate Search. Hope it work. Thank you for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.