title: NoSuchMethodError when using Infinispan Query API
body: <p>I am trying to do a query in infinispan using the hibernate and the lucene. But I get No such method exception. Below is my dependency, code and the exception</p>
  
  <p>MY POM DEPENDENCY</p>
  
  <pre><code>&lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;infinispan.version&gt;LATEST&lt;/infinispan.version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.infinispan&lt;/groupId&gt;
              &lt;artifactId&gt;infinispan-embedded&lt;/artifactId&gt;
              &lt;version&gt;${infinispan.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.infinispan&lt;/groupId&gt;
              &lt;artifactId&gt;infinispan-cachestore-jdbc&lt;/artifactId&gt;
              &lt;version&gt;7.0.0.CR2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.infinispan&lt;/groupId&gt;
              &lt;artifactId&gt;infinispan-embedded-query&lt;/artifactId&gt;
              &lt;version&gt;${infinispan.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
              &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
              &lt;version&gt;5.1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-search&lt;/artifactId&gt;
              &lt;version&gt;5.1.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;c3p0&lt;/groupId&gt;
              &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
              &lt;version&gt;0.9.1.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>Here is the cache initialization and structure. I have an mysql store which has data from which I am preloading.</p>
  
  <pre><code>EmbededCache embededCache = new EmbededCache();
                  ConfigurationBuilder b = new ConfigurationBuilder();
                  b.eviction().maxEntries(100l);
                  b.indexing().enabled(true).addProperty("default.directory_provider", "ram");
                  b.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class)
                      .preload(true)
                     .fetchPersistentState(false)
                     .ignoreModifications(false)
                     .purgeOnStartup(false)
                     .table()
                     .createOnStart(false)
                     .dropOnExit(false)
                     .createOnStart(false)
                     .tableNamePrefix("SIMULATOR.SCRIPS")
                     .idColumnName("SCRP_NAME").idColumnType("VARCHAR(255)")
                     .dataColumnName("SCRP_DETAILS").dataColumnType("BLOB")
                     .timestampColumnName("SCRP_LAST_UPDATED").timestampColumnType("BIGINT")
                     .connectionPool()
                     .connectionUrl("jdbc:mysql://ip:3306")
                     .username("user")
                     .password("password")
                     .driverClass("com.mysql.jdbc.Driver");
  
                  final Configuration config = b.build();
  
                  EmbeddedCacheManager cacheManager = new DefaultCacheManager(config);
                  Cache&lt;String, ScripDetails&gt; cache = cacheManager.getCache();
  
  
                  ScripDetails scripDetails = new ScripDetails();
                  scripDetails.scripName = "ICICIBANK";
                  scripDetails.open = 2050;
                  scripDetails.high = 2030;
                  scripDetails.low = 1988;
                  scripDetails.close= 2010L;
                  scripDetails.volume = 50550;
                  scripDetails.turnover= 51515L;
                  scripDetails.date = Calendar.getInstance().getTime();
  
                  cache.put("ICICIBANK",scripDetails);
  
                  SearchManager sm = Search.getSearchManager(cache);
                  org.hibernate.search.query.dsl.QueryBuilder builder = sm.buildQueryBuilderForClass(ScripDetails.class).get();
  
                  Query luceneQuery = builder.keyword() .onField("scripName") .matching("INFY") .createQuery();
  
                  CacheQuery cacheQuery = sm.getQuery( luceneQuery );
  
                  // get the results:
                  List&lt;Object&gt; found = cacheQuery.list();
  
  java.lang.NoSuchMethodError: org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter.validateSettings(II)V
      at org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.&lt;init&gt;(Lucene50PostingsFormat.java:412)
      at org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.&lt;init&gt;(Lucene50PostingsFormat.java:403)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
      at org.apache.lucene.util.NamedSPILoader.&lt;init&gt;(NamedSPILoader.java:47)
      at org.apache.lucene.util.NamedSPILoader.&lt;init&gt;(NamedSPILoader.java:37)
      at org.apache.lucene.codecs.PostingsFormat.&lt;clinit&gt;(PostingsFormat.java:44)
      at org.apache.lucene.codecs.lucene40.Lucene40Codec.&lt;init&gt;(Lucene40Codec.java:52)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
      at org.apache.lucene.util.NamedSPILoader.&lt;init&gt;(NamedSPILoader.java:47)
      at org.apache.lucene.util.NamedSPILoader.&lt;init&gt;(NamedSPILoader.java:37)
      at org.apache.lucene.codecs.Codec.&lt;clinit&gt;(Codec.java:41)
      at org.apache.lucene.index.LiveIndexWriterConfig.&lt;init&gt;(LiveIndexWriterConfig.java:125)
      at org.apache.lucene.index.IndexWriterConfig.&lt;init&gt;(IndexWriterConfig.java:171)
      at org.hibernate.search.store.spi.DirectoryHelper.initializeIndexIfNeeded(DirectoryHelper.java:55)
      at org.hibernate.search.store.impl.RAMDirectoryProvider.start(RAMDirectoryProvider.java:52)
      at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:90)
      at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)
      at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)
      at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)
      at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)
      at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)
      at org.hibernate.search.spi.SearchIntegratorBuilder.buildIncrementalSearchFactory(SearchIntegratorBuilder.java:147)
      at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:120)
      at org.hibernate.search.engine.impl.MutableSearchFactory.addClasses(MutableSearchFactory.java:233)
      at org.infinispan.query.backend.SearchFactoryHandler$1.execute(SearchFactoryHandler.java:85)
      at org.infinispan.query.backend.TransactionHelper.runSuspendingTx(TransactionHelper.java:23)
      at org.infinispan.query.backend.SearchFactoryHandler.updateSearchFactory(SearchFactoryHandler.java:80)
      at org.infinispan.query.backend.SearchFactoryHandler.handleOnDemandRegistration(SearchFactoryHandler.java:55)
      at org.infinispan.query.backend.SearchFactoryHandler.updateKnownTypesIfNeeded(SearchFactoryHandler.java:42)
      at org.infinispan.query.backend.QueryInterceptor.updateKnownTypesIfNeeded(QueryInterceptor.java:268)
      at org.infinispan.query.backend.QueryInterceptor.processPutKeyValueCommand(QueryInterceptor.java:455)
      at org.infinispan.query.backend.QueryInterceptor.visitPutKeyValueCommand(QueryInterceptor.java:165)
      at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)
      at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:86)
      at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40)
      at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:55)
      at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)
      at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)
      at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44)
      at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)
      at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191)
      at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177)
      at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)
      at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:44)
      at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
      at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
      at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1617)
      at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097)
      at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089)
      at org.infinispan.cache.impl.DecoratedCache.put(DecoratedCache.java:522)
      at org.infinispan.persistence.manager.PersistenceManagerImpl.preloadKey(PersistenceManagerImpl.java:658)
      at org.infinispan.persistence.manager.PersistenceManagerImpl.access$000(PersistenceManagerImpl.java:70)
      at org.infinispan.persistence.manager.PersistenceManagerImpl$1.processEntry(PersistenceManagerImpl.java:234)
      at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore$2.call(JdbcStringBasedStore.java:350)
      at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore$2.call(JdbcStringBasedStore.java:317)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.infinispan.util.concurrent.WithinThreadExecutor.execute(WithinThreadExecutor.java:22)
      at java.util.concurrent.ExecutorCompletionService.submit(Unknown Source)
      at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.process(JdbcStringBasedStore.java:317)
      at org.infinispan.persistence.manager.PersistenceManagerImpl.preload(PersistenceManagerImpl.java:226)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
      at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)
      at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)
      at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)
      at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:218)
      at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:850)
      at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:599)
      at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:554)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:424)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:397)
      at com.tlab.EmbededCache.main(EmbededCache.java:55)
  
  May 07, 2015 8:01:49 AM org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore process
  ERROR: ISPN000252: Error executing parallel store task
  java.util.concurrent.ExecutionException: org.infinispan.persistence.spi.PersistenceException: Unable to preload!
      at java.util.concurrent.FutureTask.report(Unknown Source)
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.process(JdbcStringBasedStore.java:364)
      at org.infinispan.persistence.manager.PersistenceManagerImpl.preload(PersistenceManagerImpl.java:226)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
      at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)
      at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)
      at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)
      at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:218)
      at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:850)
      at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:599)
      at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:554)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:424)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:397)
      at com.tlab.EmbededCache.main(EmbededCache.java:55)
  Caused by: org.infinispan.persistence.spi.PersistenceException: Unable to preload!
  </code></pre>