-->
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: Trouble with getDirectoryProviders
PostPosted: Thu Jul 01, 2010 1:46 pm 
Newbie

Joined: Thu Jul 01, 2010 11:50 am
Posts: 4
Hello,

I'm having some problems with getDirectoryProviders returning null. I'm using Hibernate Search 3.2.0 Final running on JBoss 6.0 M3.

Sample code: (Scala)

Code:
   private val entityManager = Search.getFullTextEntityManager(em)
   val searchFactory = entityManager.getSearchFactory()      
   val provider = searchFactory.getDirectoryProviders(entityClass)(0)


My config in persistence.xml:

Code:
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="C:\search"/>


The third line above returns a NullPointerException when trying to access the first array element.

Any ideas appreciated!
Greg


Top
 Profile  
 
 Post subject: Re: Trouble with getDirectoryProviders
PostPosted: Thu Jul 01, 2010 4:27 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you're sure entityClass is indexed (annotated)?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Trouble with getDirectoryProviders
PostPosted: Mon Jul 05, 2010 3:56 pm 
Newbie

Joined: Thu Jul 01, 2010 11:50 am
Posts: 4
Here's a clip from the entity class. I removed a lot of other fields (many of which have relationships/joins), but for testing only one non-joined field is annotated for indexing.
Code:
@Entity
@Table(name = "AV_T_PART_CATEGORY")
@Indexed
public class AvTPartCategory implements java.io.Serializable {
   public static final long serialVersionUID = -1;
   private Long partCtgrId;
   private String partCtgrName;

   // Transient attributes
   @Transient
   private String indexTimestamp;

   public AvTPartCategory() {
   }

   @Id
   @Column(name = "PART_CTGR_ID", nullable = false, precision = 22, scale = 0)
   @NotNull
   public Long getPartCtgrId() {
      return this.partCtgrId;
   }

   public void setPartCtgrId(Long partCtgrId) {
      this.partCtgrId = partCtgrId;
   }

   @Column(name = "PART_CTGR_NAME", nullable = false, length = 80)
   @NotNull
   @Length(max = 80)
   @Field(index = Index.UN_TOKENIZED, store = Store.YES)
   public String getPartCtgrName() {
      return this.partCtgrName;
   }

   public void setPartCtgrName(String partCtgrName) {
      this.partCtgrName = partCtgrName;
   }
}


Is there anything obviously wrong with this code? Any known issues w/Hibernate Search and JBoss 6.0.0.M3?

Thanks,
Greg


Top
 Profile  
 
 Post subject: Re: Trouble with getDirectoryProviders
PostPosted: Mon Jul 05, 2010 5:58 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
val searchFactory = entityManager.getSearchFactory()
val provider = searchFactory.getDirectoryProviders(entityClass)(0)

you're sure that searchFactory!=null ?

could you provide a testcase or a minimal sample app I could run?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Trouble with getDirectoryProviders
PostPosted: Tue Jul 06, 2010 9:34 pm 
Newbie

Joined: Thu Jul 01, 2010 11:50 am
Posts: 4
That's a very kind offer but I'm not really sure how to section a chunk off into something "portable".

I did do some further research and tracing. My searchFactory is non-null but the list of directory providers is null. Back-tracing the code through SearchFactoryImpl.initDocumentBuilders I discovered that there are no class mappings in the SearchConfiguration object. Tracing a bit further back it would seem these class mappings originate from Hibernate someplace, so this is likely a Hibernate configuration issue somewhere that is causing problems for Search. Hibernate is not picking up my annotated entity classes for some reason.

This isn't going to be fun...

Greg


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.