Problems "query lookup strategy" with Spring Boot 2.1.x and Ignite 2.7.0

classic Classic list List threaded Threaded
2 messages Options
Pedrotti Michele Pedrotti Michele
Reply | Threaded
Open this post in threaded view
|

Problems "query lookup strategy" with Spring Boot 2.1.x and Ignite 2.7.0

Hi, I have a SpringBoot’s application 2.1.X and a simple local installation of ignite 2.7.0.

I have problems when I add to my Repository two simple query methods (without this methods I don’t have problems, the simple call to “repo.findById” works correctly ) like this:

@RepositoryConfig(cacheName = IgniteConfig.CACHE_NAME)

public interface PresenceRepository extends IgniteRepository<PresenceStateEntity, String> {

    @Query("subscriberId = ?")

    List<PresenceStateEntity> getPresenceBySubscriberId(long subscriberId);

    @Query("brasIp = ?")

    List<PresenceStateEntity> getPresenceByBrasIp(String brasIp);

}

I am using ignite-spring-data_2.0 , spring-data-commons: 2.0.9 , ignite-spring 2.7.0…

The exception is :

Caused by: java.lang.IllegalStateException: You have defined query method in the repository but you don't have any query lookup strategy defined. The infrastructure apparently does not support query methods!

     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:545)

     at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:324)

     at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)

     at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)

     at org.springframework.data.util.Lazy.get(Lazy.java:94)

     at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)

     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804)

     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741)

     ... 58 more

 

Thanks

                Michele

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

Rispetta l'ambiente. Non stampare questa mail se non è necessario.
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Problems "query lookup strategy" with Spring Boot 2.1.x and Ignite 2.7.0

Hello!

Maybe this answer is relevant:

Otherwise, I think that @Query will expect SQL queries in their value.

Regards,
--
Ilya Kasnacheev


пн, 10 июн. 2019 г. в 13:06, Pedrotti Michele <[hidden email]>:

Hi, I have a SpringBoot’s application 2.1.X and a simple local installation of ignite 2.7.0.

I have problems when I add to my Repository two simple query methods (without this methods I don’t have problems, the simple call to “repo.findById” works correctly ) like this:

@RepositoryConfig(cacheName = IgniteConfig.CACHE_NAME)

public interface PresenceRepository extends IgniteRepository<PresenceStateEntity, String> {

    @Query("subscriberId = ?")

    List<PresenceStateEntity> getPresenceBySubscriberId(long subscriberId);

    @Query("brasIp = ?")

    List<PresenceStateEntity> getPresenceByBrasIp(String brasIp);

}

I am using ignite-spring-data_2.0 , spring-data-commons: 2.0.9 , ignite-spring 2.7.0…

The exception is :

Caused by: java.lang.IllegalStateException: You have defined query method in the repository but you don't have any query lookup strategy defined. The infrastructure apparently does not support query methods!

     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:545)

     at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:324)

     at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)

     at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)

     at org.springframework.data.util.Lazy.get(Lazy.java:94)

     at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)

     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804)

     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741)

     ... 58 more

 

Thanks

                Michele

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

Rispetta l'ambiente. Non stampare questa mail se non è necessario.