<div class="gmail_quote">Hi,<br><br>I have a problem in getting through the querying feature of infinispan. I am using the technical preview listed in this <a href="http://www.jboss.org/community/wiki/QueryingInfinispan" target="_blank">wiki page</a> with the help of the sample code provided in the same page.<br>
<br>I used the following properties for the second argument in QueryHelper Constructor.<br>#hibernate.properties<br>hibernate.search.default.directory_provider org.hibernate.search.store.FSDirectoryProvider<br>hibernate.search.default.indexBase=/usr/vin/lucene/indexes<br>
<br>This is my class for Hibernate Search<br><br>@ProvidedId<br>@Indexed<br>public class Item {<br><br> @Field<br> private String name;<br> @Field<br> private String description;<br><br>...// getters and setters<br>
}<br><br>I have included the @ProvidedId since QueryHelper instantiation validates the classes based on this annotation.<br><i><b>Note ::</b> QueryHelper.validateClasses() -- This is to check that both the @ProvidedId is present and the the @DocumentId is not present. This is because don't want both of these 2 annotations used at the same time.</i><br>
<br>When I used the @Indexed annotation for the above class, it throws an exception while instantiating the QueryHelper.<br><br><font style="font-family: courier new,monospace;" size="2"><Exception Snippet><br>java.lang.NullPointerException<br>
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.init(DocumentBuilderIndexedEntity.java:151)<br> at org.hibernate.search.engine.DocumentBuilderContainedEntity.<init>(DocumentBuilderContainedEntity.java:93)<br>
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.<init>(DocumentBuilderIndexedEntity.java:128)<br> at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:409)<br>
at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:119)<br> at org.infinispan.query.backend.QueryHelper.<init>(QueryHelper.java:87)<br><Exception Snippet></font><br>
<br>When I removed that @Indexed annotation, QueryHelper got instantiated but it throwed some exception when it hits CacheQuery.getBasicQuery() method, where it forms lucene query string with the help of QueryParser.<br>
<span style="font-family: courier new,monospace;"><br>
org.hibernate.HibernateException: There are no mapped entities. Don't forget to add @Indexed to at least one class.</span><br><br>Please let me know if I missed anything here.<br><br>Thanks in advance,<br></div>Vinoth<br>