Support for Spring Boot/Data 2.x
crocy opened this issue · comments
When can we expect proper support for Spring Boot/Data 2.x (and Spring Framework 5.x) for OrientDB 3.x?
If you don't have any methods declared in your repository interface (the one that extends OrientObjectRepository<>
) Spring Boot/Data 2.x works (with spring-data-orientdb
version 0.14-3.0.1-SNAPSHOT
), but as soon as you add a method, even a simple one like findFirstBy
you get an exception:
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:532)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:317)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$3(RepositoryFactoryBeanSupport.java:287)
at org.springframework.data.util.Lazy.getNullable(Lazy.java:141)
at org.springframework.data.util.Lazy.get(Lazy.java:63)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:290)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1767)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1704)
... 29 common frames omitted
I have the exact same problem.
is this module for spring data abandoned ? I can't see recents commits ...
Hi all
It's our intention to keep supporting the module.
The module still relies on orientdb-object module, so most of the problems in the Spring module depend on problems on that, so we fix them there.
In general, you can expect some improved support on this module in the very near future.
About this specific issue, do you have a test case to reproduce it?
Thanks
Luigi
Well in my case a the test case is not complex, a simple repository with a findByName function throw the exception. defaults method FindAll work well;
With debugging I have seen that the "getQueryLookupStrategy" called is the one from the spring's RepositoryFactorySupport intead of the one in the child class OrientRepositoryFactory. the wrong one always return null so impossible to have queries ....
Hey, thanks for the reply.
I've made a simple repo case here: https://github.com/crocy/spring-boot-orientdb-hello-test
All the instructions to reproduce the bug should be in the README file (just run the project basically), but if you need any more help with it, just let me know.
Thank you very much @crocy I'll check it asap
Luigi
Hi @crocy
I managed to run your test and to reproduce the problem.
I also checked the source code and I saw that it's exactly the same as our sample https://github.com/orientechnologies/spring-data-orientdb/tree/master/spring-data-orientdb-samples/spring-boot-orientdb-hello apart from the fact that our test uses Maven and your one uses Gradle.
Our test works fine, so I tend to say that it's a problem in the dependency configuration. I tried to tweak it but with no success. I'll keep trying and let you know
Thanks
Luigi
Hey @luigidellaquila, I know, I did copy your sample, but if I just update the dependencies in your spring-data-orientdb/pom.xml
to
<spring.version>5.0.7.RELEASE</spring.version>
<spring.data.version>2.0.8.RELEASE</spring.data.version>
<spring.boot.version>2.0.3.RELEASE</spring.boot.version>
the code doesn't compile (I can't run the HelloApplication
example), so my example is the best I can provide atm and is an actual issue I have to deal with. If there's anything else I might be able to help you with, let me know.
BR
Hi @crocy
It seems I'm doing too many things at once... now I got what you mean.
I'm checking it now
Thanks
Luigi
Hey @luigidellaquila , thanks for all the work :)
I've updated my Spring Boot dep. to 2.0.3 (with Spring Data 2.0.8 and Spring Framework 5.0.7 dependencies) and my spring-data-orientdb-*
to 0.14-3.1.0-SNAPSHOT
and the problem seems to be fixed! :)
When can we expect the spring-data-orientdb-*
dep. to become a more "official" version (0.14-3.1.0-SNAPSHOT
sounds kind of like a alpha/beta/unstable-ish version)? Would also be nice to update the versions in the spring-data-orientdb/README.md
to the latest one ;)
Thanks
Croc
Hi @crocy
If you are using OrientDB v 3.0.x, please use spring-data-orientdb-* v 0.14-3.0.5-SNAPSHOT.
To have a GA, we have to attach the official release of the packages to the main release train, I think we'll do it in next few weeks
Thanks
Luigi
Will do, tnx. I saw 0.14-3.1.0-SNAPSHOT
in spring-data-orientdb/pom.xml
develop
branch and thought that's the version to use. I've noticed now there's also a 3.0.x
branch and will be using that one now.