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

Spring JIRA | Assaf | 4 years ago
  1. 0

    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)

    Spring JIRA | 4 years ago | Assaf
    org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.
  2. 0

    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)

    Spring JIRA | 4 years ago | Assaf
    org.springframework.dao.InvalidDataAccessApiUsageException: Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.
  3. 0

    How to manually force a commit in a @Transactional method?

    Stack Overflow | 2 years ago | Eric B.
    org.springframework.dao.InvalidDataAccessApiUsageException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead; nested exception is java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JPA + Spring + declarative/manual transactions - Spring Forum

    spring.io | 11 months ago
    org.springframework.dao.InvalidDataAccessApiUsageException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead; nested exception is java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
  6. 0

    [cas-user] Unable to integrate Mongo-Service-Management in CAS 4.2.0

    Google Groups | 7 months ago | Sami Ghayeni
    org.springframework.dao.InvalidDataAccessApiUsageException: Usage of 'UserCredentials' with 'MongoClient' is no longer supported. Please use 'MongoCredential' for 'MongoClient' or just 'Mongo'.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.dao.InvalidDataAccessApiUsageException

      Cannot constructQuery '*"los an"'. Use epxression or mulitple clauses instead.

      at org.springframework.data.solr.core.query.Criteria.assertNoBlankInWildcardedQuery()
    2. Spring Data Solr
      SolrQueryCreator.create
      1. org.springframework.data.solr.core.query.Criteria.assertNoBlankInWildcardedQuery(Criteria.java:596)
      2. org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:269)
      3. org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:294)
      4. org.springframework.data.solr.core.query.Criteria.startsWith(Criteria.java:282)
      5. org.springframework.data.solr.repository.query.SolrQueryCreator.from(SolrQueryCreator.java:106)
      6. org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:56)
      7. org.springframework.data.solr.repository.query.SolrQueryCreator.create(SolrQueryCreator.java:43)
      7 frames
    3. Spring Data Core
      AbstractQueryCreator.createQuery
      1. org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109)
      2. org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88)
      3. org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73)
      3 frames
    4. Spring Data Solr
      AbstractSolrQuery.execute
      1. org.springframework.data.solr.repository.query.PartTreeSolrQuery.createQuery(PartTreeSolrQuery.java:46)
      2. org.springframework.data.solr.repository.query.AbstractSolrQuery.execute(AbstractSolrQuery.java:95)
      2 frames
    5. Spring Data Core
      RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
      1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:312)
      1 frame
    6. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame
    7. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
      3 frames
    8. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      1 frame
    9. Spring Tx
      PersistenceExceptionTranslationInterceptor.invoke
      1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
      1 frame
    10. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    11. Unknown
      $Proxy44.findByAutocompleteLike
      1. $Proxy44.findByAutocompleteLike(Unknown Source)
      1 frame