org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have the following repository: public interface POISearchRepository extends PagingAndSortingRepository<POISearch, String>{ List<POISearch> findByAutocompleteStartingWith(String autocomplete, Pageable pageable); } When I make this call: List<POISearch> results = repository.findByAutocompleteStartingWith("los ange", new PageRequest(0, max)); I get the following exception: SEVERE: Servlet.service() for servlet [spring-mvc] in context with path [/xxx] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.] with root cause org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead. at org.springframework.data.solr.core.query.Criteria.assertNoBlankInWildcardedQuery(Criteria.java:596) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:269) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:294) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:282) at org.springframework.data.solr.repository.query.SolrQueryCreator.from(SolrQueryCreator.java:106) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:56) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:43) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.solr.repository.query.PartTreeSolrQuery.createQuery(PartTreeSolrQuery.java:46) at org.springframework.data.solr.repository.query.AbstractSolrQuery.execute(AbstractSolrQuery.java:95) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:312) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy44.findByAutocompleteLike(Unknown Source)
    via by Assaf,
  • I have the following repository: public interface POISearchRepository extends PagingAndSortingRepository<POISearch, String>{ List<POISearch> findByAutocompleteStartingWith(String autocomplete, Pageable pageable); } When I make this call: List<POISearch> results = repository.findByAutocompleteStartingWith("los ange", new PageRequest(0, max)); I get the following exception: SEVERE: Servlet.service() for servlet [spring-mvc] in context with path [/xxx] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.] with root cause org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead. at org.springframework.data.solr.core.query.Criteria.assertNoBlankInWildcardedQuery(Criteria.java:596) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:269) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:294) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:282) at org.springframework.data.solr.repository.query.SolrQueryCreator.from(SolrQueryCreator.java:106) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:56) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:43) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.solr.repository.query.PartTreeSolrQuery.createQuery(PartTreeSolrQuery.java:46) at org.springframework.data.solr.repository.query.AbstractSolrQuery.execute(AbstractSolrQuery.java:95) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:312) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy44.findByAutocompleteLike(Unknown Source)
    via by Assaf,
    • org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead. at org.springframework.data.solr.core.query.Criteria.assertNoBlankInWildcardedQuery(Criteria.java:596) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:269) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:294) at org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:282) at org.springframework.data.solr.repository.query.SolrQueryCreator.from(SolrQueryCreator.java:106) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:56) at org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:43) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) at org.springframework.data.solr.repository.query.PartTreeSolrQuery.createQuery(PartTreeSolrQuery.java:46) at org.springframework.data.solr.repository.query.AbstractSolrQuery.execute(AbstractSolrQuery.java:95) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:312) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy44.findByAutocompleteLike(Unknown Source)
    No Bugmate found.