theodo-fintech / spring-search

Provides advanced search capabilities to a JPA entity
MIT License
193 stars 44 forks source link

I have an error.No primary or default constructor found for interface org.springframework.data.jpa.domain.Specification.How to solve it? #14

Closed dipeshhkc closed 3 years ago

cbbasfaltos commented 4 years ago

I have the same problem. @dipesh429, do you solve it?

pelletier197 commented 3 years ago

There is not a lot of details here, but I faced the same issue when writing spring tests. The reason was that the annotation WebMvcTest did not include the configuration that registers the custom argument resolver privided by this framework.

Fix was simply to add the annotation to my test class that imports the webmvc configuration.

@WebMvcTest(MyEndpoint::class)
@Import(com.sipios.springsearch.configuration.ResolverConf::class)
class MyEndpointIT {
}
luc-boussant commented 3 years ago

Is this issue still relevant actually ? We can maybe add a troubleshooting for this error.

dipeshhkc commented 3 years ago

I havenot used java(spring) for a while. So I am not following this question. Please close it if it is solved. :bow:

pelletier197 commented 3 years ago

Maybe just add the documentation to show how to write spring tests should be enough. It doesn't work out of the box with spring mvc since the Resolver Configuration is not loaded.

There is no problem with the library itself

luc-boussant commented 3 years ago

Hello, I am having a hard time finding the time for this issue. I will close it for now. If someone wants to create the MR with the documentation I will be happy to read and approve it as soon as possible